@mintlify/cli 4.1.18 → 4.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,8 +4,8 @@ import { dirname as __mintDirname } from 'node:path';
|
|
|
4
4
|
const require = __mintCreateRequire(import.meta.url);
|
|
5
5
|
const __filename = __mintFileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __mintDirname(__filename);
|
|
7
|
-
import{Ct as e,G as t,J as n,K as r,Mt as i,Q as a,St as o,T as s,X as c,Y as l,Z as u,ct as d,dt as f,et as p,ft as m,gt as h,i as g,it as _,jt as v,k as y,kt as b,lt as x,n as S,ot as C,pt as ee,q as te,r as ne,t as re,tt as ie,v as ae}from"./schemas-CBsmCNpK.js";function oe(){return[ee(),m(),f(),x(),d()]}var se=b();function ce(e,t){let n=e.position?.start.offset,r=e.position?.end.offset;return typeof n==`number`&&typeof r==`number`?t.slice(n,r):``}function le(e,t){if(!t)return;let n=e.at(-1);n?.type===`text`?n.value+=t:e.push({type:`text`,value:t})}function ue(e,t){let n=ce(e,t),r=e.url.trim();return n.startsWith(`[`)&&r.length>0&&(/^(?:https?:\/\/|mailto:|tel:|\/|#|\.\.?\/)/i.test(r)||r.includes(`/`)||/^[^\s@]+\.[^\s]+$/u.test(r))}function de(e,t){let n=[];for(let r of e)switch(r.type){case`text`:le(n,r.value.replace(/\n/g,` `));break;case`inlineCode`:n.push({type:`inlineCode`,value:r.value});break;case`strong`:case`emphasis`:case`delete`:n.push(Object.assign(Object.assign({},r),{children:de(r.children,t)}));break;case`link`:ue(r,t)?n.push(Object.assign(Object.assign({},r),{children:de(r.children,t)})):le(n,ce(r,t));break;default:le(n,ce(r,t))}return n}const fe=/[\\&*_`[\]!<>~@\0\t\n\r]|:\/\/|www\.|\s$/i;function pe(e){if(!e)return[];if(!fe.test(e))return[{type:`text`,value:e}];try{let t=`title: `,n=`${t}${e.replace(/\n/g,` `)}`,r=h(n,{extensions:[C()],mdastExtensions:[oe()]}),i=r.children.length===1?r.children[0]:void 0;if(i?.type!==`paragraph`)return[{type:`text`,value:e}];let a=de(i.children,n),o=a[0];return o?.type!==`text`||!o.value.startsWith(t)?[{type:`text`,value:e}]:(o.value=o.value.slice(7),o.value||a.shift(),a)}catch{return[{type:`text`,value:e}]}}function me(e){return y({type:`paragraph`,children:pe(e)})}function he(e){this.content=e}he.prototype={constructor:he,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new he(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new he(n)},addToStart:function(e,t){return new he([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new he(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new he(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=he.from(e),e.size?new he(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=he.from(e),e.size?new he(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=he.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},he.from=function(e){if(e instanceof he)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new he(t)};function ge(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ge(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function _e(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=_e(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}var ve=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ge(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return _e(this,e,t,n)}findIndex(e){if(e==0)return be(0,e);if(e==this.size)return be(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?be(t+1,i):be(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};ve.empty=new ve([],0);const ye={index:0,offset:0};function be(e,t){return ye.index=e,ye.offset=t,ye}function xe(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!xe(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!xe(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Se=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xe(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Se.none=[];var Ce=class extends Error{},we=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ee(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Te(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(ve.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};we.empty=new we(ve.empty,0,0);function Te(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Te(a.content,t-i-1,n-i-1)))}function Ee(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Ee(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function De(e,t,n){if(n.openStart>e.depth)throw new Ce(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ce(`Inconsistent open depths`);return Oe(e,t,n,0)}function Oe(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Oe(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Ne(a,Fe(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ne(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ie(n,e);return Ne(a,Pe(e,i,o,t,r))}}function ke(e,t){if(!t.type.compatibleContent(e.type))throw new Ce(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ae(e,t,n){let r=e.node(n);return ke(r,t.node(n)),r}function je(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(je(e.nodeAfter,r),a++));for(let e=a;e<o;e++)je(i.child(e),r);t&&t.depth==n&&t.textOffset&&je(t.nodeBefore,r)}function Ne(e,t){return e.type.checkContent(t),e.copy(t)}function Pe(e,t,n,r,i){let a=e.depth>i&&Ae(e,t,i+1),o=r.depth>i&&Ae(n,r,i+1),s=[];return Me(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ke(a,o),je(Ne(a,Pe(e,t,n,r,i+1)),s)):(a&&je(Ne(a,Fe(e,t,i+1)),s),Me(t,n,i,s),o&&je(Ne(o,Fe(n,r,i+1)),s)),Me(r,null,i,s),new ve(s)}function Fe(e,t,n){let r=[];return Me(null,e,n,r),e.depth>n&&je(Ne(Ae(e,t,n+1),Fe(e,t,n+1)),r),Me(t,null,n,r),new ve(r)}function Ie(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(ve.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Le=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Se.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Be(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=w.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else w.set(t,r=new Re);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ze,i}},Re=class{constructor(){this.elts=[],this.i=0}};const ze=12,w=/* @__PURE__ */ new WeakMap;var Be=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const Ve=Object.create(null);var He=class e{constructor(e,t,n,r=Se.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ve.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&xe(this.attrs,t||e.defaultAttrs||Ve)&&Se.sameSet(this.marks,n||Se.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return we.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new we(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return De(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Le.resolveCached(this,e)}resolveNoCache(e){return Le.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),We(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=ve.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Se.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Se.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=ve.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};He.prototype.text=void 0;var Ue=class e extends He{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):We(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function We(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Ge=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ke(t,n);if(r.next==null)return e.empty;let i=qe(r);r.next&&r.err(`Unexpected trailing text`);let a=tt(Qe(i));return nt(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return ve.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
8
|
-
`)}};Ge.empty=new Ge(!0);var Ke=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function qe(e){let t=[];do t.push(Je(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Je(e){let t=[];do t.push(Ye(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Ye(e){let t=Ze(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Xe(e,t);else break;return t}function T(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Xe(e,t){let n=T(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:T(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function E(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Ze(e){if(e.eat(`(`)){let t=qe(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=E(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Qe(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function $e(e,t){return t-e}function et(e,t){let n=[];return r(t),n.sort($e);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function tt(e){let t=Object.create(null);return n(et(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);et(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ge(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort($e);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function nt(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function rt(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function it(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function at(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function ot(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new lt(e,r,t[r]);return n}var st=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=ot(e,n.attrs),this.defaultAttrs=rt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ge.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:it(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new He(this,this.computeAttrs(e),ve.from(t),Se.setFrom(n))}createChecked(e=null,t,n){return t=ve.from(t),this.checkContent(t),new He(this,this.computeAttrs(e),t,Se.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=ve.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(ve.empty,!0);return i?new He(this,e,t.append(i),Se.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){at(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Se.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ct(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var lt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ct(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ut=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ot(e,r.attrs),this.excluded=null;let i=rt(this.attrs);this.instance=i?new Se(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Se(this,it(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){at(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},dt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=he.from(e.nodes),t.marks=he.from(e.marks||{}),this.nodes=st.compile(this.spec.nodes,this),this.marks=ut.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ge.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ft(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ft(this,n.split(` `))}this.nodeFromJSON=e=>He.fromJSON(this,e),this.markFromJSON=e=>Se.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof st))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ue(n,n.defaultAttrs,e,Se.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ft(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}const pt={};function mt(e){let t=this,n=e||pt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(C(n)),a.push(c()),o.push(u(n))}const ht={};function gt(e){let t=this,i=e||ht,a=t.data(),o=a.micromarkExtensions||=[],s=a.fromMarkdownExtensions||=[],c=a.toMarkdownExtensions||=[];o.push(r(i)),s.push(te()),c.push(n(i))}var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,D=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Ct=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},wt=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Ct(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),Tt=D({"../../node_modules/acorn-jsx/xhtml.js"(e,t){t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}}}),Et=D({"../../node_modules/acorn/dist/acorn.js"(e,t){(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function ee(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var te=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ne=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,re=Object.prototype,ie=re.hasOwnProperty,ae=re.toString,oe=Object.hasOwn||(function(e,t){return ie.call(e,t)}),se=Array.isArray||(function(e){return ae.call(e)===`[object Array]`});function ce(e){return RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`)}function le(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ue=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,de=function(e,t){this.line=e,this.column=t};de.prototype.offset=function(e){return new de(this.line,this.column+e)};var fe=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function pe(e,t){for(var n=1,r=0;;){var i=ee(e,r,t);if(i<0)return new de(n,t-r);++n,r=i}}var me={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},he=!1;function ge(e){var t={};for(var n in me)t[n]=e&&oe(e,n)?e[n]:me[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!he&&typeof console==`object`&&console.warn&&(he=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
7
|
+
import{$ as e,At as t,Ct as n,J as r,K as i,Mt as a,Nt as o,Q as s,T as c,X as l,Y as u,Z as d,_t as f,at as p,ft as m,i as h,k as g,lt as _,mt as v,n as y,nt as b,pt as x,q as S,r as C,st as ee,t as te,tt as ne,ut as re,v as ie,wt as ae}from"./schemas-BfdUTdtz.js";function oe(){return[v(),x(),m(),re(),_()]}var se=t();function ce(e,t){let n=e.position?.start.offset,r=e.position?.end.offset;return typeof n==`number`&&typeof r==`number`?t.slice(n,r):``}function le(e,t){if(!t)return;let n=e.at(-1);n?.type===`text`?n.value+=t:e.push({type:`text`,value:t})}function ue(e,t){let n=ce(e,t),r=e.url.trim();return n.startsWith(`[`)&&r.length>0&&(/^(?:https?:\/\/|mailto:|tel:|\/|#|\.\.?\/)/i.test(r)||r.includes(`/`)||/^[^\s@]+\.[^\s]+$/u.test(r))}function de(e,t){let n=[];for(let r of e)switch(r.type){case`text`:le(n,r.value.replace(/\n/g,` `));break;case`inlineCode`:n.push({type:`inlineCode`,value:r.value});break;case`strong`:case`emphasis`:case`delete`:n.push(Object.assign(Object.assign({},r),{children:de(r.children,t)}));break;case`link`:ue(r,t)?n.push(Object.assign(Object.assign({},r),{children:de(r.children,t)})):le(n,ce(r,t));break;default:le(n,ce(r,t))}return n}const fe=/[\\&*_`[\]!<>~@\0\t\n\r]|:\/\/|www\.|\s$/i;function pe(e){if(!e)return[];if(!fe.test(e))return[{type:`text`,value:e}];try{let t=`title: `,n=`${t}${e.replace(/\n/g,` `)}`,r=f(n,{extensions:[ee()],mdastExtensions:[oe()]}),i=r.children.length===1?r.children[0]:void 0;if(i?.type!==`paragraph`)return[{type:`text`,value:e}];let a=de(i.children,n),o=a[0];return o?.type!==`text`||!o.value.startsWith(t)?[{type:`text`,value:e}]:(o.value=o.value.slice(7),o.value||a.shift(),a)}catch{return[{type:`text`,value:e}]}}function me(e){return g({type:`paragraph`,children:pe(e)})}function he(e){this.content=e}he.prototype={constructor:he,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new he(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new he(n)},addToStart:function(e,t){return new he([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new he(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new he(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=he.from(e),e.size?new he(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=he.from(e),e.size?new he(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=he.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},he.from=function(e){if(e instanceof he)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new he(t)};function ge(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ge(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function _e(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=_e(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}var ve=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ge(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return _e(this,e,t,n)}findIndex(e){if(e==0)return be(0,e);if(e==this.size)return be(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?be(t+1,i):be(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};ve.empty=new ve([],0);const ye={index:0,offset:0};function be(e,t){return ye.index=e,ye.offset=t,ye}function xe(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!xe(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!xe(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Se=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xe(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Se.none=[];var Ce=class extends Error{},we=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ee(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Te(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(ve.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};we.empty=new we(ve.empty,0,0);function Te(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Te(a.content,t-i-1,n-i-1)))}function Ee(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Ee(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function De(e,t,n){if(n.openStart>e.depth)throw new Ce(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ce(`Inconsistent open depths`);return Oe(e,t,n,0)}function Oe(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Oe(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Ne(a,Fe(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ne(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ie(n,e);return Ne(a,Pe(e,i,o,t,r))}}function ke(e,t){if(!t.type.compatibleContent(e.type))throw new Ce(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ae(e,t,n){let r=e.node(n);return ke(r,t.node(n)),r}function je(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(je(e.nodeAfter,r),a++));for(let e=a;e<o;e++)je(i.child(e),r);t&&t.depth==n&&t.textOffset&&je(t.nodeBefore,r)}function Ne(e,t){return e.type.checkContent(t),e.copy(t)}function Pe(e,t,n,r,i){let a=e.depth>i&&Ae(e,t,i+1),o=r.depth>i&&Ae(n,r,i+1),s=[];return Me(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ke(a,o),je(Ne(a,Pe(e,t,n,r,i+1)),s)):(a&&je(Ne(a,Fe(e,t,i+1)),s),Me(t,n,i,s),o&&je(Ne(o,Fe(n,r,i+1)),s)),Me(r,null,i,s),new ve(s)}function Fe(e,t,n){let r=[];return Me(null,e,n,r),e.depth>n&&je(Ne(Ae(e,t,n+1),Fe(e,t,n+1)),r),Me(t,null,n,r),new ve(r)}function Ie(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(ve.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Le=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Se.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Be(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=w.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else w.set(t,r=new Re);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ze,i}},Re=class{constructor(){this.elts=[],this.i=0}};const ze=12,w=/* @__PURE__ */ new WeakMap;var Be=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const Ve=Object.create(null);var He=class e{constructor(e,t,n,r=Se.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ve.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&xe(this.attrs,t||e.defaultAttrs||Ve)&&Se.sameSet(this.marks,n||Se.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return we.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new we(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return De(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Le.resolveCached(this,e)}resolveNoCache(e){return Le.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),We(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=ve.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Se.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Se.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=ve.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};He.prototype.text=void 0;var Ue=class e extends He{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):We(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function We(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Ge=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ke(t,n);if(r.next==null)return e.empty;let i=qe(r);r.next&&r.err(`Unexpected trailing text`);let a=tt(Qe(i));return nt(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return ve.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
8
|
+
`)}};Ge.empty=new Ge(!0);var Ke=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function qe(e){let t=[];do t.push(Je(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Je(e){let t=[];do t.push(Ye(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Ye(e){let t=Ze(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Xe(e,t);else break;return t}function T(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Xe(e,t){let n=T(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:T(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function E(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Ze(e){if(e.eat(`(`)){let t=qe(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=E(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Qe(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function $e(e,t){return t-e}function et(e,t){let n=[];return r(t),n.sort($e);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function tt(e){let t=Object.create(null);return n(et(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);et(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ge(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort($e);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function nt(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function rt(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function it(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function at(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function ot(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new lt(e,r,t[r]);return n}var st=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=ot(e,n.attrs),this.defaultAttrs=rt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ge.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:it(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new He(this,this.computeAttrs(e),ve.from(t),Se.setFrom(n))}createChecked(e=null,t,n){return t=ve.from(t),this.checkContent(t),new He(this,this.computeAttrs(e),t,Se.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=ve.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(ve.empty,!0);return i?new He(this,e,t.append(i),Se.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){at(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Se.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ct(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var lt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ct(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ut=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ot(e,r.attrs),this.excluded=null;let i=rt(this.attrs);this.instance=i?new Se(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Se(this,it(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){at(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},dt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=he.from(e.nodes),t.marks=he.from(e.marks||{}),this.nodes=st.compile(this.spec.nodes,this),this.marks=ut.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ge.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ft(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ft(this,n.split(` `))}this.nodeFromJSON=e=>He.fromJSON(this,e),this.markFromJSON=e=>Se.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof st))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ue(n,n.defaultAttrs,e,Se.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ft(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}const pt={};function mt(e){let t=this,n=e||pt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ee(n)),a.push(d()),o.push(s(n))}const ht={};function gt(e){let t=this,n=e||ht,i=t.data(),a=i.micromarkExtensions||=[],o=i.fromMarkdownExtensions||=[],s=i.toMarkdownExtensions||=[];a.push(S(n)),o.push(r()),s.push(u(n))}var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,D=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Ct=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},wt=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Ct(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),Tt=D({"../../node_modules/acorn-jsx/xhtml.js"(e,t){t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}}}),Et=D({"../../node_modules/acorn/dist/acorn.js"(e,t){(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function ee(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var te=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ne=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,re=Object.prototype,ie=re.hasOwnProperty,ae=re.toString,oe=Object.hasOwn||(function(e,t){return ie.call(e,t)}),se=Array.isArray||(function(e){return ae.call(e)===`[object Array]`});function ce(e){return RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`)}function le(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ue=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,de=function(e,t){this.line=e,this.column=t};de.prototype.offset=function(e){return new de(this.line,this.column+e)};var fe=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function pe(e,t){for(var n=1,r=0;;){var i=ee(e,r,t);if(i<0)return new de(n,t-r);++n,r=i}}var me={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},he=!1;function ge(e){var t={};for(var n in me)t[n]=e&&oe(e,n)?e[n]:me[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!he&&typeof console==`object`&&console.warn&&(he=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
9
9
|
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),se(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return se(t.onComment)&&(t.onComment=_e(t,t.onComment)),t}function _e(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new fe(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ve=1,ye=2,be=4,xe=8,Se=16,Ce=32,we=64,Te=128,Ee=256,De=ve|ye|Ee;function Oe(e,t){return ye|(e?be:0)|(t?xe:0)}var ke=0,Ae=1,je=2,Me=3,Ne=4,Pe=5,Fe=function(e,t,n){this.options=e=ge(e),this.sourceFile=e.sourceFile,this.keywords=ce(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=ce(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=ce(i),this.reservedWordsStrictBind=ce(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
10
10
|
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=/* @__PURE__ */ Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ve),this.regexpState=null,this.privateNameStack=[]},Ie={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Fe.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Ie.inFunction.get=function(){return(this.currentVarScope().flags&ye)>0},Ie.inGenerator.get=function(){return(this.currentVarScope().flags&xe)>0&&!this.currentVarScope().inClassFieldInit},Ie.inAsync.get=function(){return(this.currentVarScope().flags&be)>0&&!this.currentVarScope().inClassFieldInit},Ie.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Ee)return!1;if(t.flags&ye)return(t.flags&be)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ie.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&we)>0||n||this.options.allowSuperOutsideMethod},Ie.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Te)>0},Ie.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ie.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(ye|Ee))>0||n},Ie.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ee)>0},Fe.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Fe.parse=function(e,t){return new this(t,e).parse()},Fe.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Fe.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Fe.prototype,Ie);var Le=Fe.prototype,Re=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Le.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){ne.lastIndex=e,e+=ne.exec(this.input)[0].length;var t=Re.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){ne.lastIndex=e+t[0].length;var n=ne.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,ne.lastIndex=e,e+=ne.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Le.eat=function(e){return this.type===e&&(this.next(),!0)},Le.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Le.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Le.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Le.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Le.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Le.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Le.expect=function(e){this.eat(e)||this.unexpected()},Le.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var ze=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Le.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Le.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Le.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var w=Fe.prototype;w.parseTopLevel=function(e){var t=/* @__PURE__ */ Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var Be={kind:`loop`},Ve={kind:`switch`};w.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;ne.lastIndex=this.pos;var t=ne.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(f(r,!0)){for(var i=n+1;p(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!c.test(a))return!0}return!1},w.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;ne.lastIndex=this.pos;var e=ne.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},w.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){ne.lastIndex=this.pos;var o=ne.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===b.name&&u.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},w.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},w.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},w.parseDoStatement=function(e){return this.next(),this.labels.push(Be),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},w.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Be),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=this.isContextual(`let`),o=!1,s=new ze,c=this.parseExpression(t>-1?`await`:!0,s);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),a&&o&&this.raise(c.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(c,!1,s),this.checkLValPattern(c),this.parseForIn(e,c)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,c))},w.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Ue|(n?0:We),!1,t)},w.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},w.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},w.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(Ve),this.enterScope(0);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},w.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var He=[];w.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();if(this.next(),this.eat(b.parenL)){t.param=this.parseBindingAtom();var n=t.param.type===`Identifier`;this.enterScope(n?Ce:0),this.checkLValPattern(t.param,n?Ne:je),this.expect(b.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},w.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},w.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Be),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},w.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},w.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},w.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},w.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},w.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},w.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},w.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},w.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(b.eq)?r.init=this.parseMaybeAssign(t):n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():r.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):r.init=null,e.declarations.push(this.finishNode(r,`VariableDeclarator`)),!this.eat(b.comma))break}return e},w.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?Ae:je,!1)};var Ue=1,We=2,Ge=4;w.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&We&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ue&&(e.id=t&Ge&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&We)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Ae:je:Me));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Oe(e.async,e.generator)),t&Ue||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Ue?`FunctionDeclaration`:`FunctionExpression`)},w.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},w.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raise(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Ke(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},w.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&qe(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},w.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},w.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},w.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&qe(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},w.parseClassField=function(e){if(qe(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&qe(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,`PropertyDefinition`)},w.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ee|we);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},w.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,je,!1)):(t===!0&&this.unexpected(),e.id=null)},w.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},w.enterClassBody=function(){var e={declared:/* @__PURE__ */ Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},w.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,n=e.used,r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];oe(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Ke(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function qe(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}w.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`);if(this.eat(b._default)){this.checkExport(t,`default`,this.lastTokStart);var n;if(this.type===b._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,Ue|Ge,!1,n)}else if(this.type===b._class){var i=this.startNode();e.declaration=this.parseClass(i,`nullableID`)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,`ExportDefaultDeclaration`)}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,o=e.specifiers;a<o.length;a+=1){var s=o[a];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type===`Literal`&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},w.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),oe(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},w.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`?this.checkPatternExport(e,t.argument):n===`ParenthesizedExpression`&&this.checkPatternExport(e,t.expression)},w.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},w.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},w.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual(`as`)?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,`ExportSpecifier`))}return t},w.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=He,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},w.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLValSimple(n.local,je),e.push(this.finishNode(n,`ImportDefaultSpecifier`)),!this.eat(b.comma))return e}if(this.type===b.star){var r=this.startNode();return this.next(),this.expectContextual(`as`),r.local=this.parseIdent(),this.checkLValSimple(r.local,je),e.push(this.finishNode(r,`ImportNamespaceSpecifier`)),e}for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var i=this.startNode();i.imported=this.parseModuleExportName(),this.eatContextual(`as`)?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLValSimple(i.local,je),e.push(this.finishNode(i,`ImportSpecifier`))}return e},w.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return ue.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},w.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},w.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Je=Fe.prototype;Je.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Je.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Je.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Je.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Je.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Je.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(b.comma),t&&this.type===b.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===b.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},Je.parseBindingListItem=function(e){return e},Je.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Je.checkLValSimple=function(e,t,n){t===void 0&&(t=ke);var r=t!==ke;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===je&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(oe(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Pe&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Je.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=ke),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Je.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=ke),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Ye=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},T={b_stat:new Ye(`{`,!1),b_expr:new Ye(`{`,!0),b_tmpl:new Ye("${",!1),p_stat:new Ye(`(`,!1),p_expr:new Ye(`(`,!0),q_tmpl:new Ye("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ye(`function`,!1),f_expr:new Ye(`function`,!0),f_expr_gen:new Ye(`function`,!0,!1,null,!0),f_gen:new Ye(`function`,!1,!1,null,!0)},Xe=Fe.prototype;Xe.initialContext=function(){return[T.b_stat]},Xe.curContext=function(){return this.context[this.context.length-1]},Xe.braceIsBlock=function(e){var t=this.curContext();return t===T.f_expr||t===T.f_stat?!0:e===b.colon&&(t===T.b_stat||t===T.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===T.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Xe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Xe.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Xe.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===T.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?T.b_stat:T.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(T.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?T.p_stat:T.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===T.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==T.b_stat)?this.context.push(T.f_expr):this.context.push(T.f_stat),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===T.q_tmpl?this.context.pop():this.context.push(T.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===T.f_expr?this.context[t]=T.f_expr_gen:this.context[t]=T.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var E=Fe.prototype;E.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},E.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===b.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(b.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},E.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ze,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},E.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},E.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},E.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},E.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},E.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&s.argument.type===`Identifier`?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Ze(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Ze(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Ze(e.expression)}E.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},E.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},E.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new ze,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseArrowExpression(this.startNodeAt(t,n),h,!0,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},E.parseExprAtom=function(e,t){this.type===b.slash&&this.readRegexp();var n,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),n=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(n.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(n,`Super`);case b._this:return n=this.startNode(),this.next(),this.finishNode(n,`ThisExpression`);case b.name:var i=this.start,a=this.startLoc,o=this.containsEsc,s=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&s.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(T.f_expr),this.parseFunction(this.startNodeAt(i,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(i,a),[s],!1,t);if(this.options.ecmaVersion>=8&&s.name===`async`&&this.type===b.name&&!o&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return s=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,a),[s],!0,t)}return s;case b.regexp:var c=this.value;return n=this.parseLiteral(c.value),n.regex={pattern:c.pattern,flags:c.flags},n;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return n=this.startNode(),n.value=this.type===b._null?null:this.type===b._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,`Literal`);case b.parenL:var l=this.start,u=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),u;case b.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(n,`ArrayExpression`);case b.braceL:return this.overrideContext(T.b_expr),this.parseObj(!1,e);case b._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},E.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`);var t=this.parseIdent(!0);switch(this.type){case b.parenL:return this.parseDynamicImport(e);case b.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},E.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},E.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},E.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},E.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},E.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new ze,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},E.parseParenItem=function(e){return e},E.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Qe=[];E.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc,a=this.type===b._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0,!1),a&&e.callee.type===`ImportExpression`&&this.raise(r,`Cannot use new with import()`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Qe,this.finishNode(e,`NewExpression`)},E.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
11
11
|
`),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},E.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},E.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},E.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},E.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},E.parsePropertyValue=function(e,t,n,r,i,a,o,s){if((n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`;else if(this.options.ecmaVersion>=6&&this.type===b.parenL)t&&this.unexpected(),e.kind=`init`,e.method=!0,e.value=this.parseMethod(n,r);else if(!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq){(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c=e.kind===`get`?0:1;if(e.value.params.length!==c){var l=e.value.start;e.kind===`get`?this.raiseRecoverable(l,`getter should have no params`):this.raiseRecoverable(l,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind=`init`,t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()},E.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},E.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},E.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Oe(t,r.generator)|we|(n?Te:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},E.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Oe(n,!1)|Se),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},E.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Pe),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},E.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},E.checkParams=function(e,t){for(var n=/* @__PURE__ */ Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,Ae,t?null:n)}},E.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},E.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.currentThisScope().inClassFieldInit&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},E.parseIdent=function(e){var t=this.startNode();return this.type===b.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name===`class`||t.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},E.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e},E.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},E.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var $e=Fe.prototype;$e.raise=function(e,t){var n=pe(this.input,e);t+=` (`+n.line+`:`+n.column+`)`;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},$e.raiseRecoverable=$e.raise,$e.curPosition=function(){if(this.options.locations)return new de(this.curLine,this.pos-this.lineStart)};var et=Fe.prototype,tt=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};et.enterScope=function(e){this.scopeStack.push(new tt(e))},et.exitScope=function(){this.scopeStack.pop()},et.treatFunctionsAsVarInScope=function(e){return e.flags&ye||!this.inModule&&e.flags&ve},et.declareName=function(e,t,n){var r=!1;if(t===je){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ve&&delete this.undefinedExports[e]}else if(t===Ne)this.currentScope().lexical.push(e);else if(t===Me){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&Ce&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ve&&delete this.undefinedExports[e],s.flags&De)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},et.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},et.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},et.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&De)return t}},et.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&De&&!(t.flags&Se))return t}};var nt=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new fe(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},rt=Fe.prototype;rt.startNode=function(){return new nt(this,this.start,this.startLoc)},rt.startNodeAt=function(e,t){return new nt(this,e,t)};function it(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}rt.finishNode=function(e,t){return it.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},rt.finishNodeAt=function(e,t,n,r){return it.call(this,e,t,n,r)},rt.copyNode=function(e){var t=new nt(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var at=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,ot=at+` Extended_Pictographic`,st=ot,ct=st+` EBase EComp EMod EPres ExtPict`,lt=ct,ut={9:at,10:ot,11:st,12:ct,13:lt,14:lt},dt=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,ft=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,pt=ft+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,mt=pt+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ht=mt+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,gt=ht+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,_t={9:ft,10:pt,11:mt,12:ht,13:gt,14:gt+` Kawi Nag_Mundari Nagm`},vt={};function yt(e){var t=vt[e]={binary:ce(ut[e]+` `+dt),nonBinary:{General_Category:ce(dt),Script:ce(_t[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var bt=0,xt=[9,10,11,12,13,14];bt<xt.length;bt+=1){var St=xt[bt];yt(St)}var D=Fe.prototype,Ct=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``),this.unicodeProperties=vt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Ct.prototype.reset=function(e,t,n){var r=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},Ct.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},Ct.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Ct.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},Ct.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},Ct.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Ct.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Ct.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},D.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r<n.length;r++){var i=n.charAt(r);t.indexOf(i)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(i,r+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`)}},D.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},D.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames.indexOf(r)===-1&&e.raise(`Invalid named capture referenced`)}},D.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},D.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},D.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},D.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},D.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},D.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},D.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},D.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},D.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},D.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}e.pos=t}return!1},D.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},D.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},D.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},D.regexp_eatSyntaxCharacter=function(e){var t=e.current();return wt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function wt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}D.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!wt(n);)e.advance();return e.pos!==t},D.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},D.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise(`Duplicate capture group name`),e.groupNames.push(e.lastStringValue);return}e.raise(`Invalid group`)}},D.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},D.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=le(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=le(e.lastIntValue);return!0}return!1},D.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Tt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Tt(e){return f(e,!0)||e===36||e===95}D.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Et(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Et(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}D.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},D.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},D.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},D.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},D.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},D.regexp_eatZero=function(e){return e.current()===48&&!jt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},D.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},D.regexp_eatControlLetter=function(e){var t=e.current();return Dt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Dt(e){return e>=65&&e<=90||e>=97&&e<=122}D.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&O(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function O(e){return e>=0&&e<=1114111}D.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},D.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1},D.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ot(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise(`Invalid property name`)}return!1};function Ot(e){return e===100||e===68||e===115||e===83||e===119||e===87}D.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},D.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){oe(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},D.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise(`Invalid property name`)},D.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;kt(t=e.current());)e.lastStringValue+=le(t),e.advance();return e.lastStringValue!==``};function kt(e){return Dt(e)||e===95}D.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;At(t=e.current());)e.lastStringValue+=le(t),e.advance();return e.lastStringValue!==``};function At(e){return kt(e)||jt(e)}D.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},D.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise(`Unterminated character class`)}return!1},D.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},D.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Pt(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},D.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},D.regexp_eatClassControlLetter=function(e){var t=e.current();return jt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},D.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},D.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;jt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function jt(e){return e>=48&&e<=57}D.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Mt(n=e.current());)e.lastIntValue=16*e.lastIntValue+Nt(n),e.advance();return e.pos!==t};function Mt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Nt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}D.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},D.regexp_eatOctalDigit=function(e){var t=e.current();return Pt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Pt(e){return e>=48&&e<=55}D.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Mt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Nt(i),e.advance()}return!0};var Ft=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new fe(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},k=Fe.prototype;k.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Ft(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},k.getToken=function(){return this.next(),new Ft(this)},typeof Symbol<`u`&&(k[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),k.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},k.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},k.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},k.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=ee(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},k.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},k.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&te.test(String.fromCharCode(e)))++this.pos;else break loop}}},k.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},k.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},k.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},k.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},k.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},k.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},k.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},k.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},k.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},k.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},k.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+le(t)+`'`)},k.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+le(e)+`'`)},k.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},k.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new Ct(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},k.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function It(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Lt(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}k.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Lt(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},k.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Lt(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=It(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},k.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},k.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Rt={};k.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Rt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},k.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rt;this.raise(e,t)},k.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
@@ -31,9 +31,9 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
31
31
|
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(zd).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=J.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=/* @__PURE__ */ Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(sf),this.regexpState=null,this.privateNameStack=[]},Tf={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};wf.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Tf.inFunction.get=function(){return(this.currentVarScope().flags&cf)>0},Tf.inGenerator.get=function(){return(this.currentVarScope().flags&uf)>0&&!this.currentVarScope().inClassFieldInit},Tf.inAsync.get=function(){return(this.currentVarScope().flags&lf)>0&&!this.currentVarScope().inClassFieldInit},Tf.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&hf)return!1;if(t.flags&cf)return(t.flags&lf)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Tf.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&pf)>0||n||this.options.allowSuperOutsideMethod},Tf.allowDirectSuper.get=function(){return(this.currentThisScope().flags&mf)>0},Tf.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Tf.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(cf|hf))>0||n},Tf.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&hf)>0},wf.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},wf.parse=function(e,t){return new this(t,e).parse()},wf.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},wf.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(wf.prototype,Tf);var Ef=wf.prototype,Df=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Ef.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Wd.lastIndex=e,e+=Wd.exec(this.input)[0].length;var t=Df.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){Wd.lastIndex=e+t[0].length;var n=Wd.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||zd.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,Wd.lastIndex=e,e+=Wd.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Ef.eat=function(e){return this.type===e&&(this.next(),!0)},Ef.isContextual=function(e){return this.type===J.name&&this.value===e&&!this.containsEsc},Ef.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Ef.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Ef.canInsertSemicolon=function(){return this.type===J.eof||this.type===J.braceR||zd.test(this.input.slice(this.lastTokEnd,this.start))},Ef.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ef.semicolon=function(){!this.eat(J.semi)&&!this.insertSemicolon()&&this.unexpected()},Ef.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Ef.expect=function(e){this.eat(e)||this.unexpected()},Ef.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Of=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ef.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Ef.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Ef.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Ef.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Y=wf.prototype;Y.parseTopLevel=function(e){var t=/* @__PURE__ */ Object.create(null);for(e.body||=[];this.type!==J.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var kf={kind:`loop`},Af={kind:`switch`};Y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;Wd.lastIndex=this.pos;var t=Wd.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Nd(r,!0)){for(var i=n+1;Pd(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!kd.test(a))return!0}return!1},Y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;Wd.lastIndex=this.pos;var e=Wd.exec(this.input),t=this.pos+e[0].length,n;return!zd.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(Pd(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},Y.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=J._var,a=`let`),r){case J._break:case J._continue:return this.parseBreakContinueStatement(i,r.keyword);case J._debugger:return this.parseDebuggerStatement(i);case J._do:return this.parseDoStatement(i);case J._for:return this.parseForStatement(i);case J._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case J._class:return e&&this.unexpected(),this.parseClass(i,!0);case J._if:return this.parseIfStatement(i);case J._return:return this.parseReturnStatement(i);case J._switch:return this.parseSwitchStatement(i);case J._throw:return this.parseThrowStatement(i);case J._try:return this.parseTryStatement(i);case J._const:case J._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case J._while:return this.parseWhileStatement(i);case J._with:return this.parseWithStatement(i);case J.braceL:return this.parseBlock(!0,i);case J.semi:return this.parseEmptyStatement(i);case J._export:case J._import:if(this.options.ecmaVersion>10&&r===J._import){Wd.lastIndex=this.pos;var o=Wd.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===J._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===J.name&&u.type===`Identifier`&&this.eat(J.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},Y.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(J.semi)||this.insertSemicolon()?e.label=null:this.type===J.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Y.parseDoStatement=function(e){return this.next(),this.labels.push(kf),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(J._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(J.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(kf),this.enterScope(0),this.expect(J.parenL),this.type===J.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===J._var||this.type===J._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=this.isContextual(`let`),o=!1,s=new Of,c=this.parseExpression(t>-1?`await`:!0,s);return this.type===J._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),a&&o&&this.raise(c.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(c,!1,s),this.checkLValPattern(c),this.parseForIn(e,c)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,c))},Y.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Mf|(n?0:Nf),!1,t)},Y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(J._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Y.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(J.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Y.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(J.braceL),this.labels.push(Af),this.enterScope(0);for(var t,n=!1;this.type!==J.braceR;)if(this.type===J._case||this.type===J._default){var r=this.type===J._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(J.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Y.parseThrowStatement=function(e){return this.next(),zd.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var jf=[];Y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===J._catch){var t=this.startNode();if(this.next(),this.eat(J.parenL)){t.param=this.parseBindingAtom();var n=t.param.type===`Identifier`;this.enterScope(n?ff:0),this.checkLValPattern(t.param,n?Sf:bf),this.expect(J.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(J._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Y.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(kf),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Y.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===J._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Y.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(J.braceL),e&&this.enterScope(0);this.type!==J.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Y.parseFor=function(e,t){return e.init=t,this.expect(J.semi),e.test=this.type===J.semi?null:this.parseExpression(),this.expect(J.semi),e.update=this.type===J.parenR?null:this.parseExpression(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Y.parseForIn=function(e,t){var n=this.type===J._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Y.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(J.eq)?r.init=this.parseMaybeAssign(t):n===`const`&&!(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():r.id.type!==`Identifier`&&(!t||this.type!==J._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):r.init=null,e.declarations.push(this.finishNode(r,`VariableDeclarator`)),!this.eat(J.comma))break}return e},Y.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?yf:bf,!1)};var Mf=1,Nf=2,Pf=4;Y.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===J.star&&t&Nf&&this.unexpected(),e.generator=this.eat(J.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Mf&&(e.id=t&Pf&&this.type!==J.name?null:this.parseIdent(),e.id&&!(t&Nf)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?yf:bf:xf));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_f(e.async,e.generator)),t&Mf||(e.id=this.type===J.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Mf?`FunctionDeclaration`:`FunctionExpression`)},Y.parseFunctionParams=function(e){this.expect(J.parenL),e.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Y.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(J.braceL);this.type!==J.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raise(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Ff(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Y.parseClassElement=function(e){if(this.eat(J.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(J.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===J.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===J.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(J.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===J.parenL||o!==`method`||i||a){var l=!n.static&&If(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},Y.isClassElementNameStart=function(){return this.type===J.name||this.type===J.privateId||this.type===J.num||this.type===J.string||this.type===J.bracketL||this.type.keyword},Y.parseClassElementName=function(e){this.type===J.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Y.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&If(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},Y.parseClassField=function(e){if(If(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&If(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(J.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,`PropertyDefinition`)},Y.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(hf|pf);this.type!==J.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},Y.parseClassId=function(e,t){this.type===J.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,bf,!1)):(t===!0&&this.unexpected(),e.id=null)},Y.parseClassSuper=function(e){e.superClass=this.eat(J._extends)?this.parseExprSubscripts(null,!1):null},Y.enterClassBody=function(){var e={declared:/* @__PURE__ */ Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Y.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,n=e.used,r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];Jd(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Ff(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function If(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}Y.parseExport=function(e,t){if(this.next(),this.eat(J.star))return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`);if(this.eat(J._default)){this.checkExport(t,`default`,this.lastTokStart);var n;if(this.type===J._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,Mf|Pf,!1,n)}else if(this.type===J._class){var i=this.startNode();e.declaration=this.parseClass(i,`nullableID`)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,`ExportDefaultDeclaration`)}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,o=e.specifiers;a<o.length;a+=1){var s=o[a];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type===`Literal`&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Y.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),Jd(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Y.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`?this.checkPatternExport(e,t.argument):n===`ParenthesizedExpression`&&this.checkPatternExport(e,t.expression)},Y.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Y.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Y.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(J.braceL);!this.eat(J.braceR);){if(n)n=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual(`as`)?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,`ExportSpecifier`))}return t},Y.parseImport=function(e){return this.next(),this.type===J.string?(e.specifiers=jf,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===J.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===J.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLValSimple(n.local,bf),e.push(this.finishNode(n,`ImportDefaultSpecifier`)),!this.eat(J.comma))return e}if(this.type===J.star){var r=this.startNode();return this.next(),this.expectContextual(`as`),r.local=this.parseIdent(),this.checkLValSimple(r.local,bf),e.push(this.finishNode(r,`ImportNamespaceSpecifier`)),e}for(this.expect(J.braceL);!this.eat(J.braceR);){if(t)t=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var i=this.startNode();i.imported=this.parseModuleExportName(),this.eatContextual(`as`)?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLValSimple(i.local,bf),e.push(this.finishNode(i,`ImportSpecifier`))}return e},Y.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===J.string){var e=this.parseLiteral(this.value);return Qd.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},Y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Y.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Lf=wf.prototype;Lf.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Lf.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Lf.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Lf.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==J.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Lf.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case J.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(J.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case J.braceL:return this.parseObj(!0)}return this.parseIdent()},Lf.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(J.comma),t&&this.type===J.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===J.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},Lf.parseBindingListItem=function(e){return e},Lf.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(J.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Lf.checkLValSimple=function(e,t,n){t===void 0&&(t=vf);var r=t!==vf;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===bf&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(Jd(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Cf&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Lf.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=vf),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Lf.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=vf),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Rf=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},zf={b_stat:new Rf(`{`,!1),b_expr:new Rf(`{`,!0),b_tmpl:new Rf("${",!1),p_stat:new Rf(`(`,!1),p_expr:new Rf(`(`,!0),q_tmpl:new Rf("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Rf(`function`,!1),f_expr:new Rf(`function`,!0),f_expr_gen:new Rf(`function`,!0,!1,null,!0),f_gen:new Rf(`function`,!1,!1,null,!0)},Bf=wf.prototype;Bf.initialContext=function(){return[zf.b_stat]},Bf.curContext=function(){return this.context[this.context.length-1]},Bf.braceIsBlock=function(e){var t=this.curContext();return t===zf.f_expr||t===zf.f_stat?!0:e===J.colon&&(t===zf.b_stat||t===zf.b_expr)?!t.isExpr:e===J._return||e===J.name&&this.exprAllowed?zd.test(this.input.slice(this.lastTokEnd,this.start)):e===J._else||e===J.semi||e===J.eof||e===J.parenR||e===J.arrow?!0:e===J.braceL?t===zf.b_stat:e===J._var||e===J._const||e===J.name?!1:!this.exprAllowed},Bf.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Bf.updateContext=function(e){var t,n=this.type;n.keyword&&e===J.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Bf.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},J.parenR.updateContext=J.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===zf.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},J.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?zf.b_stat:zf.b_expr),this.exprAllowed=!0},J.dollarBraceL.updateContext=function(){this.context.push(zf.b_tmpl),this.exprAllowed=!0},J.parenL.updateContext=function(e){var t=e===J._if||e===J._for||e===J._with||e===J._while;this.context.push(t?zf.p_stat:zf.p_expr),this.exprAllowed=!0},J.incDec.updateContext=function(){},J._function.updateContext=J._class.updateContext=function(e){e.beforeExpr&&e!==J._else&&(e!==J.semi||this.curContext()===zf.p_stat)&&!(e===J._return&&zd.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==J.colon&&e!==J.braceL||this.curContext()!==zf.b_stat)?this.context.push(zf.f_expr):this.context.push(zf.f_stat),this.exprAllowed=!1},J.backQuote.updateContext=function(){this.curContext()===zf.q_tmpl?this.context.pop():this.context.push(zf.q_tmpl),this.exprAllowed=!1},J.star.updateContext=function(e){if(e===J._function){var t=this.context.length-1;this.context[t]===zf.f_expr?this.context[t]=zf.f_expr_gen:this.context[t]=zf.f_gen}this.exprAllowed=!0},J.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==J.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var X=wf.prototype;X.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},X.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===J.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(J.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},X.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Of,r=!0);var s=this.start,c=this.startLoc;(this.type===J.parenL||this.type===J.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===J.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===J.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},X.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(J.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(J.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},X.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},X.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==J._in)&&a>r){var o=this.type===J.logicalOR||this.type===J.logicalAND,s=this.type===J.coalesce;s&&(a=J.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===J.coalesce||s&&(this.type===J.logicalOR||this.type===J.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},X.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},X.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===J.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&s.argument.type===`Identifier`?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Vf(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===J.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==J._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(J.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Vf(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Vf(e.expression)}X.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},X.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},X.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(J.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(J.bracketL);if(l||c&&this.type!==J.parenL&&this.type!==J.backQuote||this.eat(J.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(J.bracketR)):u.property=this.type===J.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(J.parenL)){var d=new Of,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseArrowExpression(this.startNodeAt(t,n),h,!0,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===J.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},X.parseExprAtom=function(e,t){this.type===J.slash&&this.readRegexp();var n,r=this.potentialArrowAt===this.start;switch(this.type){case J._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),n=this.startNode(),this.next(),this.type===J.parenL&&!this.allowDirectSuper&&this.raise(n.start,`super() call outside constructor of a subclass`),this.type!==J.dot&&this.type!==J.bracketL&&this.type!==J.parenL&&this.unexpected(),this.finishNode(n,`Super`);case J._this:return n=this.startNode(),this.next(),this.finishNode(n,`ThisExpression`);case J.name:var i=this.start,a=this.startLoc,o=this.containsEsc,s=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&s.name===`async`&&!this.canInsertSemicolon()&&this.eat(J._function))return this.overrideContext(zf.f_expr),this.parseFunction(this.startNodeAt(i,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(J.arrow))return this.parseArrowExpression(this.startNodeAt(i,a),[s],!1,t);if(this.options.ecmaVersion>=8&&s.name===`async`&&this.type===J.name&&!o&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return s=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(J.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,a),[s],!0,t)}return s;case J.regexp:var c=this.value;return n=this.parseLiteral(c.value),n.regex={pattern:c.pattern,flags:c.flags},n;case J.num:case J.string:return this.parseLiteral(this.value);case J._null:case J._true:case J._false:return n=this.startNode(),n.value=this.type===J._null?null:this.type===J._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,`Literal`);case J.parenL:var l=this.start,u=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),u;case J.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(J.bracketR,!0,!0,e),this.finishNode(n,`ArrayExpression`);case J.braceL:return this.overrideContext(zf.b_expr),this.parseObj(!1,e);case J._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case J._class:return this.parseClass(this.startNode(),!1);case J._new:return this.parseNew();case J.backQuote:return this.parseTemplate();case J._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},X.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`);var t=this.parseIdent(!0);switch(this.type){case J.parenL:return this.parseDynamicImport(e);case J.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},X.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(J.parenR)){var t=this.start;this.eat(J.comma)&&this.eat(J.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},X.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},X.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},X.parseParenExpression=function(){this.expect(J.parenL);var e=this.parseExpression();return this.expect(J.parenR),e},X.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Of,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==J.parenR;){if(l?l=!1:this.expect(J.comma),a&&this.afterTrailingComma(J.parenR,!0)){u=!0;break}if(this.type===J.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(J.parenR),e&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},X.parseParenItem=function(e){return e},X.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Hf=[];X.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(J.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc,a=this.type===J._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0,!1),a&&e.callee.type===`ImportExpression`&&this.raise(r,`Cannot use new with import()`),e.arguments=this.eat(J.parenL)?this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1):Hf,this.finishNode(e,`NewExpression`)},X.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===J.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
32
32
|
`),cooked:this.value},this.next(),n.tail=this.type===J.backQuote,this.finishNode(n,`TemplateElement`)},X.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===J.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(J.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(J.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},X.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===J.name||this.type===J.num||this.type===J.string||this.type===J.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===J.star)&&!zd.test(this.input.slice(this.lastTokEnd,this.start))},X.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(J.braceR);){if(r)r=!1;else if(this.expect(J.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(J.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},X.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(J.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===J.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(J.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(J.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},X.parsePropertyValue=function(e,t,n,r,i,a,o,s){if((n||r)&&this.type===J.colon&&this.unexpected(),this.eat(J.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`;else if(this.options.ecmaVersion>=6&&this.type===J.parenL)t&&this.unexpected(),e.kind=`init`,e.method=!0,e.value=this.parseMethod(n,r);else if(!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==J.comma&&this.type!==J.braceR&&this.type!==J.eq){(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c=e.kind===`get`?0:1;if(e.value.params.length!==c){var l=e.value.start;e.kind===`get`?this.raiseRecoverable(l,`getter should have no params`):this.raiseRecoverable(l,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind=`init`,t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===J.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()},X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(J.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(J.bracketR),e.key;e.computed=!1}return e.key=this.type===J.num||this.type===J.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},X.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_f(t,r.generator)|pf|(n?mf:0)),this.expect(J.parenL),r.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},X.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(_f(n,!1)|df),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},X.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==J.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Cf),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},X.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},X.checkParams=function(e,t){for(var n=/* @__PURE__ */ Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,yf,t?null:n)}},X.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(J.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===J.comma?o=null:this.type===J.ellipsis?(o=this.parseSpread(r),r&&this.type===J.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},X.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.currentThisScope().inClassFieldInit&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},X.parseIdent=function(e){var t=this.startNode();return this.type===J.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name===`class`||t.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},X.parsePrivateIdent=function(){var e=this.startNode();return this.type===J.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e},X.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===J.semi||this.canInsertSemicolon()||this.type!==J.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(J.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},X.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Uf=wf.prototype;Uf.raise=function(e,t){var n=tf(this.input,e);t+=` (`+n.line+`:`+n.column+`)`;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Uf.raiseRecoverable=Uf.raise,Uf.curPosition=function(){if(this.options.locations)return new $d(this.curLine,this.pos-this.lineStart)};var Wf=wf.prototype,Gf=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Wf.enterScope=function(e){this.scopeStack.push(new Gf(e))},Wf.exitScope=function(){this.scopeStack.pop()},Wf.treatFunctionsAsVarInScope=function(e){return e.flags&cf||!this.inModule&&e.flags&sf},Wf.declareName=function(e,t,n){var r=!1;if(t===bf){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&sf&&delete this.undefinedExports[e]}else if(t===Sf)this.currentScope().lexical.push(e);else if(t===xf){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&ff&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&sf&&delete this.undefinedExports[e],s.flags&gf)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Wf.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Wf.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Wf.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&gf)return t}},Wf.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&gf&&!(t.flags&df))return t}};var Kf=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new ef(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},qf=wf.prototype;qf.startNode=function(){return new Kf(this,this.start,this.startLoc)},qf.startNodeAt=function(e,t){return new Kf(this,e,t)};function Jf(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}qf.finishNode=function(e,t){return Jf.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},qf.finishNodeAt=function(e,t,n,r){return Jf.call(this,e,t,n,r)},qf.copyNode=function(e){var t=new Kf(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Yf=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,Xf=Yf+` Extended_Pictographic`,Zf=Xf,Qf=Zf+` EBase EComp EMod EPres ExtPict`,$f=Qf,ep={9:Yf,10:Xf,11:Zf,12:Qf,13:$f,14:$f},tp=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,np=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,rp=np+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,ip=rp+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ap=ip+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,op=ap+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,sp={9:np,10:rp,11:ip,12:ap,13:op,14:op+` Kawi Nag_Mundari Nagm`},cp={};function lp(e){var t=cp[e]={binary:Xd(ep[e]+` `+tp),nonBinary:{General_Category:Xd(tp),Script:Xd(sp[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Gu=0,Ku=[9,10,11,12,13,14];Gu<Ku.length;Gu+=1)Wu=Ku[Gu],lp(Wu);var Wu,Gu,Ku,Z=wf.prototype,up=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``),this.unicodeProperties=cp[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};up.prototype.reset=function(e,t,n){var r=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},up.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},up.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},up.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},up.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},up.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},up.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},up.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Z.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r<n.length;r++){var i=n.charAt(r);t.indexOf(i)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(i,r+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`)}},Z.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Z.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames.indexOf(r)===-1&&e.raise(`Invalid named capture referenced`)}},Z.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Z.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Z.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Z.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Z.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Z.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Z.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Z.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Z.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Z.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}e.pos=t}return!1},Z.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Z.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Z.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Z.regexp_eatSyntaxCharacter=function(e){var t=e.current();return dp(t)?(e.lastIntValue=t,e.advance(),!0):!1};function dp(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Z.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!dp(n);)e.advance();return e.pos!==t},Z.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},Z.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise(`Duplicate capture group name`),e.groupNames.push(e.lastStringValue);return}e.raise(`Invalid group`)}},Z.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Z.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Zd(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Zd(e.lastIntValue);return!0}return!1},Z.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),fp(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function fp(e){return Nd(e,!0)||e===36||e===95}Z.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),pp(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function pp(e){return Pd(e,!0)||e===36||e===95||e===8204||e===8205}Z.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Z.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Z.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Z.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Z.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Z.regexp_eatZero=function(e){return e.current()===48&&!yp(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Z.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},Z.regexp_eatControlLetter=function(e){var t=e.current();return mp(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function mp(e){return e>=65&&e<=90||e>=97&&e<=122}Z.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&hp(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function hp(e){return e>=0&&e<=1114111}Z.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},Z.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1},Z.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(gp(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise(`Invalid property name`)}return!1};function gp(e){return e===100||e===68||e===115||e===83||e===119||e===87}Z.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},Z.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Jd(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Z.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise(`Invalid property name`)},Z.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;_p(t=e.current());)e.lastStringValue+=Zd(t),e.advance();return e.lastStringValue!==``};function _p(e){return mp(e)||e===95}Z.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;vp(t=e.current());)e.lastStringValue+=Zd(t),e.advance();return e.lastStringValue!==``};function vp(e){return _p(e)||yp(e)}Z.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Z.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise(`Unterminated character class`)}return!1},Z.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Z.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Sp(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},Z.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Z.regexp_eatClassControlLetter=function(e){var t=e.current();return yp(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Z.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Z.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;yp(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function yp(e){return e>=48&&e<=57}Z.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;bp(n=e.current());)e.lastIntValue=16*e.lastIntValue+xp(n),e.advance();return e.pos!==t};function bp(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function xp(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Z.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},Z.regexp_eatOctalDigit=function(e){var t=e.current();return Sp(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Sp(e){return e>=48&&e<=55}Z.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!bp(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+xp(i),e.advance()}return!0};var Cp=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ef(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Q=wf.prototype;Q.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Cp(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Q.getToken=function(){return this.next(),new Cp(this)},typeof Symbol<`u`&&(Q[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===J.eof,value:t}}}}),Q.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(J.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Q.readToken=function(e){return Nd(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Q.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Q.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Hd(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Q.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Vd(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Q.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&Ud.test(String.fromCharCode(e)))++this.pos;else break loop}}},Q.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Q.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(J.ellipsis)):(++this.pos,this.finishToken(J.dot))},Q.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(J.assign,2):this.finishOp(J.slash,1)},Q.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?J.star:J.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=J.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(J.assign,n+1):this.finishOp(r,n)},Q.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(e===124?J.logicalOR:J.logicalAND,2):t===61?this.finishOp(J.assign,2):this.finishOp(e===124?J.bitwiseOR:J.bitwiseAND,1)},Q.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(J.assign,2):this.finishOp(J.bitwiseXOR,1)},Q.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||zd.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(J.incDec,2):t===61?this.finishOp(J.assign,2):this.finishOp(J.plusMin,1)},Q.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(J.assign,n+1):this.finishOp(J.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(J.relational,n))},Q.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(J.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(J.arrow)):this.finishOp(e===61?J.eq:J.prefix,1)},Q.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(J.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(J.coalesce,2)}return this.finishOp(J.question,1)},Q.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Nd(t,!0)||t===92))return this.finishToken(J.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Zd(t)+`'`)},Q.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(J.parenL);case 41:return++this.pos,this.finishToken(J.parenR);case 59:return++this.pos,this.finishToken(J.semi);case 44:return++this.pos,this.finishToken(J.comma);case 91:return++this.pos,this.finishToken(J.bracketL);case 93:return++this.pos,this.finishToken(J.bracketR);case 123:return++this.pos,this.finishToken(J.braceL);case 125:return++this.pos,this.finishToken(J.braceR);case 58:return++this.pos,this.finishToken(J.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(J.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(J.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Zd(e)+`'`)},Q.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Q.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(zd.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new up(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(J.regexp,{pattern:i,flags:o,value:c})},Q.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function wp(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Tp(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Q.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Tp(this.input.slice(t,this.pos)),++this.pos):Nd(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,n)},Q.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Tp(this.input.slice(t,this.pos));return++this.pos,Nd(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Nd(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=wp(this.input.slice(t,this.pos),n);return this.finishToken(J.num,a)},Q.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Q.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Vd(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(J.string,t)};var Ep={};Q.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ep)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Q.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ep;this.raise(e,t)},Q.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===J.template||this.type===J.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(J.dollarBraceL)):(++this.pos,this.finishToken(J.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(J.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Vd(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
33
33
|
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Q.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(J.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,`Unterminated template`)},Q.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
34
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Zd(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Vd(t)?``:String.fromCharCode(t)}},Q.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Q.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Pd(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Nd:Pd)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Zd(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Q.readWord=function(){var e=this.readWord1(),t=J.name;return this.keywords.test(e)&&(t=Rd[e]),this.finishToken(t,e)},wf.acorn={Parser:wf,version:`8.8.2`,defaultOptions:nf,Position:$d,SourceLocation:ef,getLineInfo:tf,Node:Kf,TokenType:K,tokTypes:J,keywordTypes:Rd,TokContext:Rf,tokContexts:zf,isIdentifierChar:Pd,isIdentifierStart:Nd,Token:Cp,isNewLine:Vd,lineBreak:zd,lineBreakG:Bd,nonASCIIwhitespace:Ud};var Dp=wt(Dt(),1),Op=wf.extend((0,Dp.default)()),kp=1024;function Ap(e,t){let n=e.type===`CallExpression`&&`callee`in e&&e.callee instanceof Kf?e.callee:e;return n.type===`ParenthesizedExpression`&&n.start===t?n.end:void 0}function jp(e){let t,n=``,r=``,i=e.length*2,a=``;return{parse(e,t={}){return Op.parse(e,Object.assign(Object.assign({},t),{ecmaVersion:t.ecmaVersion??`latest`}))},parseExpressionAt(o,s,c={}){let l=Object.assign(Object.assign({},c),{ecmaVersion:c.ecmaVersion??`latest`}),u=JSON.stringify(Object.assign(Object.assign({},l),{onComment:void 0,onToken:void 0}));if(u!==a&&(r=``,n=``,a=u),s===0&&r.length>o.length&&r.startsWith(o))throw Object.assign(/* @__PURE__ */ SyntaxError(`Unexpected end of expression`),{pos:o.length,raisedAt:o.length});try{let e=Op.parseExpressionAt(o,s,l);return r=``,n=``,e}catch(a){if(s!==0||o.length<kp||!o.trimStart().startsWith(`(`)||!(a instanceof SyntaxError)||!(`raisedAt`in a)||typeof a.raisedAt!=`number`||a.raisedAt<o.length||n!==``&&o.startsWith(n))throw a;n=o,r=``,t??=e.replace(/(\r\n|\r|\n) {1,2}/g,`$1`);let c=t.indexOf(o);if(c>=1&&t[c-1]===`{`&&t[c+o.length]===`}`&&t.indexOf(o,c+1)===-1)try{let e=t.slice(c);if(e.length>i)throw a;i-=e.length;let n=Ap(Op.parseExpressionAt(e,s,Object.assign(Object.assign({},l),{onComment:void 0,onToken:void 0,preserveParens:!0})),o.search(/\S/));n!==void 0&&n>o.length&&(r=e.slice(0,n))}catch{r=``}throw a}}}}var Mp=p().use(gt).use(mt).use(a,[`yaml`,`toml`]).freeze(),Np=Mp().use(l).freeze();function Pp(e){return e.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/).map((e,t)=>t%2==0?e.replace(/<!--([\s\S]*?)-->/g,(e,t)=>`{/* ${t} */}`):e).join(``)}function Fp(e,n={}){let r=n.omitHtmlComments??!0?Pp(e):e;return{sanitized:r,preprocessed:t(r,{preserveOriginal:!0})}}var Ip=e=>e.children.length===0||e.name===`video`;function Lp(e,t){o(e,e=>{if(!s(e)||!Ip(e))return;let n=e.position?.end.offset;n===void 0||t.endsWith(`/>`,n)||(e.data=Object.assign(Object.assign({},e.data),{closingTag:!0}))})}var Rp=[Yc({singleTilde:!0}),xd({estree:!0}),Jc([`yaml`,`toml`])],zp=[...Rp,Xc({singleDollarTextMath:!0})];function Bp(e,t){let n=Kc(e,{syntax:t?zp:Rp});if(n instanceof Error)return;let r=n;return o(r,[`mdxJsxFlowElement`,`mdxJsxTextElement`],e=>{if(`attributes`in e)for(let t of e.attributes)delete t.position}),r}function Vp(e,t=!0){let n={acorn:jp(e)},r=Bp(e,t)??(t?Np:Mp)().use(gt,n).parse(e);return Lp(r,e),t&&ae(r,e),r}function Hp(e,t={omitHtmlComments:!0}){return Vp(Fp(e,t).preprocessed,t.math)}var Up=`__expressionAttributes`,Wp=`__namedExpressionAttributes`,Gp=`__mintlifyExtraAttrs`,Kp=Symbol(`unsupported-estree`);function qp(e,t){if(!e)return Kp;switch(e.type){case`Literal`:return e.value;case`TemplateLiteral`:return e.expressions.length===0?e.quasis[0]?.value.cooked??``:Kp;case`Identifier`:return t?Kp:e.name===`undefined`?void 0:e.name;case`UnaryExpression`:{let n=qp(e.argument,t);return typeof n==`number`?e.operator===`-`?-n:e.operator===`+`?n:Kp:Kp}case`ArrayExpression`:{let n=[];for(let r of e.elements){if(!r||r.type===`SpreadElement`)return Kp;let e=qp(r,t);if(e===Kp)return Kp;n.push(e)}return n}case`ObjectExpression`:{let n={};for(let r of e.properties){if(r.type!==`Property`||r.computed||r.method||r.kind!==`init`)return Kp;let e=r,i=e.key.type===`Identifier`?e.key.name:e.key.type===`Literal`&&(typeof e.key.value==`string`||typeof e.key.value==`number`)?String(e.key.value):void 0;if(!i)return Kp;let a=e.shorthand?e.key.type===`Identifier`?qp(e.key,t):Kp:qp(e.value,t);if(a===Kp)return Kp;n[i]=a}return n}default:return Kp}}function Jp(e,t,n){let r=t?.body[0],i=qp(r?.type===`ExpressionStatement`?r.expression:void 0,n);return i===Kp?e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e:i}function Yp(e=[]){let t=$(e,{staticOnly:!0}).start;return typeof t==`number`?Number.isInteger(t)?t:1:typeof t==`string`&&/^\s*-?\d+\s*$/.test(t)?Number(t):1}function $(e=[],t={}){let n={},r=[],i={};for(let a of e){if(a.type===`mdxJsxExpressionAttribute`){r.push(a.value);continue}let e=a.value;if(typeof e==`object`&&e){let r=e.value;typeof r==`string`?(i[a.name]=r,n[a.name]=Jp(r,`data`in e?e.data?.estree??void 0:void 0,t.staticOnly??!1)):n[a.name]=r}else e==null?n[a.name]=!0:n[a.name]=e}return r.length>0&&(n[Up]=r),Object.keys(i).length>0&&(n[Wp]=i),n}function Xp(e){try{let[t]=Vp(`<X value={${e}} />`,!1).children;return t?.type!==`mdxJsxFlowElement`||t.attributes.length!==1?e:$(t.attributes).value}catch{return e}}var Zp=/* @__PURE__ */ new Set([`ref`,`key`,`dangerouslySetInnerHTML`]);function Qp(e){let t=e[Wp],n=t&&typeof t==`object`?t:{},r={};for(let[t,i]of Object.entries(e))t!==Up&&t!==Wp&&t!==Gp&&(Zp.has(t)||Ft.has(t)||t in n&&i===n[t]||(r[t]=i));return r}function $p(e,t,n=[]){let r={},i={};for(let[a,o]of Object.entries(e))n.includes(a)||(a===Up||a===Wp||t.some(e=>e.name===a)?r[a]=o:i[a]=o);return Object.keys(i).length>0&&(r[Gp]=i),r}var em=$t.filter(e=>e.name!==`type`);function tm(e){return typeof e==`string`?Ot.find(t=>t.toLowerCase()===e.toLowerCase())??null:null}function nm(e,t){if(e!==`Callout`)return Object.assign({type:e},$p(t,em));let n=tm(t.type);return Object.assign({type:n},$p(t,em,n?[`type`]:[]))}function rm(e){let t=e.split(` `).reverse();for(let[e,n]of Object.entries(Lt))if(t.includes(n))return e}function im(e){if(e&&typeof e==`object`&&`width`in e){let t=e.width;if(typeof t==`string`&&t.endsWith(`%`)){let e=parseInt(t.slice(0,-1),10);if(!isNaN(e))return e}}}var am=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function om(e,t=!1){let n=$(e.attributes),r=n.className,i;typeof r==`string`&&(i=rm(r));let a=n.style,o;am(a)&&(o=im(a));let s=Object.assign(Object.assign({},t?Object.assign({},n):n),{[k]:!0});return{type:O.image,attrs:{imgAttributes:s,align:i,width:o}}}function sm(e){return(e.type===`mdxJsxTextElement`||e.type===`mdxJsxFlowElement`)&&e.name===`source`}function cm(e){if(!e.children.every(e=>sm(e)||e.type===`text`&&e.value.trim()===``))return{type:e.type===`mdxJsxTextElement`?O.inlineUnknownTag:O.unknownTag,attrs:{mdxJsxNode:e}};let t=e.children.filter(sm).map(e=>$(e.attributes)),n=$(e.attributes);return{type:O.video,attrs:{videoAttributes:e.data?.closingTag===!0?Object.assign(Object.assign({},n),{[It]:!0}):n,sources:t.length>0?t:null}}}var lm=/* @__PURE__ */ new Set([`hidden`,`dark:block`]),um=/* @__PURE__ */ new Set([`dark:hidden`]);function dm(e){let t=e.attrs?.imgAttributes;return am(t)?t:null}function fm(e){let t=dm(e)?.className;return typeof t==`string`?t:void 0}function pm(e){if(e.type!==O.image)return!1;let t=fm(e);if(!t)return!1;let n=t.split(/\s+/);return n.includes(`hidden`)&&n.includes(`dark:block`)}function mm(e){if(e.type!==O.image)return!1;let t=fm(e);return t?t.split(/\s+/).includes(`dark:hidden`):!1}function hm(e,t){if(!e)return;let n=t===`dark`?lm:um;return e.split(/\s+/).filter(e=>!n.has(e)).join(` `).trim()||void 0}function gm(e){return Object.entries(e).filter(([e])=>e!==`src`&&e!==`className`).sort(([e],[t])=>e<t?-1:+(e>t))}function _m(e,t,n,r){let i=hm(n,`light`),a=hm(r,`dark`),o=i?.split(/\s+/).filter(e=>e!==`block`).join(` `).trim()||void 0;if(a!==i&&a!==o)return!1;let s=gm(e),c=gm(t);return s.length===c.length&&JSON.stringify(s)===JSON.stringify(c)}function vm(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=e[n+1];if(r&&i){let e,a;pm(r)&&mm(i)?(e=r,a=i):mm(r)&&pm(i)&&(a=r,e=i);let o=e?dm(e):null,s=a?dm(a):null,c=o?.src,l=s?.src;if(e&&a&&o&&s&&typeof c==`string`&&typeof l==`string`&&_m(s,o,fm(a),fm(e))){let r=hm(fm(a),`light`),i=Object.assign({},s);delete i.src,r?i.className=r:delete i.className,t.push({type:O.image,attrs:{imgAttributes:i,lightSrc:l,darkSrc:c,align:a.attrs?.align??e.attrs?.align,width:a.attrs?.width??e.attrs?.width}}),n+=2;continue}}r&&t.push(r),n++}return t}function ym(e){if(!e)return null;if(e.type===`image`)return{type:O.inlineImage,attrs:{imgAttributes:{src:e.url,alt:e.alt??void 0,title:e.title??void 0},width:100}};if(e.type===`mdxJsxTextElement`&&e.name===`img`){let t=$(e.attributes),n=100;if(t.width&&typeof t.width==`number`)n=t.width;else if(am(t.style)){let e=im(t.style);e&&(n=e)}return{type:O.inlineImage,attrs:{imgAttributes:Object.assign(Object.assign({},t),{[k]:!0}),width:n}}}return null}function bm(e,t,n){let r=xm(e,`icon`),i=xm(e,`iconType`),a=Sm(e),o=xm(e,`description`)??``,s=[{type:`paragraph`}];if(o)try{let e=Hp(o);Cm(e);let r=n(e,t),i=!Array.isArray(r)&&r.type===`doc`&&Array.isArray(r.content)?r.content:Array.isArray(r)?r:[r];i.length>0&&(s=i)}catch{s=[{type:`paragraph`,content:[Jn(o)]}]}let c=wm(e,t.source),l=$p($(e.attributes),pn,[`description`])[Gp];return{type:O.promptBlock,attrs:Object.assign({icon:r,iconType:i,actions:a},l?{[Gp]:l}:{}),content:[{type:O.promptDescription,content:s},{type:O.codeBlock,attrs:{language:`text`,__hasGroupParent:!0,__isPromptChild:!0,wrap:!0},content:c?[Jn(c)]:[]}]}}function xm(e,t){let n=$(e.attributes)[t];if(typeof n!=`string`)return;let r=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);if(r?.type===`mdxJsxAttribute`&&r.value!==null&&typeof r.value==`object`&&n===r.value.value){let e=n.trim();if(e.startsWith("`")&&e.endsWith("`"))return e.slice(1,-1).replace(/\\`/g,"`").replace(/\\\$/g,`$`).replace(/\\\\/g,`\\`)}return n}function Sm(e){let t=$(e.attributes,{staticOnly:!0}).actions;return Array.isArray(t)?t.filter(e=>typeof e==`string`):[`copy`]}function Cm(t){o(t,`link`,(t,n,r)=>{if(r&&typeof n==`number`&&t.children.length===1&&t.children[0]?.type===`text`&&t.children[0].value===t.url)return r.children[n]={type:`text`,value:t.url},e})}function wm(e,t){if(!e.position||!t)return``;let n=e.position.start.offset,r=e.position.end.offset;if(n===void 0||r===void 0)return``;let i=t.slice(n,r),a=i.match(/<\/\s*Prompt\s*>$/);if(!a)return``;let o=-1,s=0,c=!1,l=!1;for(let e=1;e<i.length;e++){let t=i[e]??``,n=i[e-1]??``;if(l)t==="`"&&n!==`\\`&&(l=!1);else if(c)t===c&&n!==`\\`&&(c=!1);else if(t==="`"&&s>0)l=!0;else if(t===`"`||t===`'`)c=t;else if(t===`{`)s++;else if(t===`}`)s--;else if(t===`>`&&s===0){o=e+1;break}}if(o===-1)return``;let u=i.length-a[0].length;return i.slice(o,u).trim()}var Tm={[O.accordion]:Qt,[O.badge]:nn,[O.card]:Xt,[O.codeBlock]:fn,[O.columns]:Zt,[O.expandable]:on,[O.frame]:an,[O.icon]:dn,[O.mermaidBlock]:mn,[O.paramField]:hn,[O.promptBlock]:pn,[O.responseField]:gn,[O.step]:Yt,[O.tab]:en,[O.tabs]:tn,[O.tooltip]:rn,[O.update]:un,[O.visibility]:sn};function Em(e,t){return $p(e,Tm[t]??[])}var Dm=/* @__PURE__ */ new Map([[O.callout,!0],[O.column,!0],[O.expandable,!0],[O.frame,!0],[O.paramField,!0],[`Prompt`,!1],[O.responseField,!0],[O.tab,!0],[O.update,!0],[O.visibility,!1],[O.accordion,!1],[O.accordionGroup,!1],[O.card,!1],[O.codeGroup,!1],[O.columns,!1],[O.requestExample,!1],[O.responseExample,!1],[O.steps,!1],[O.tabs,!1]]);function Om(e,t){let n=t.nodes[e];return!!n&&!n.isInline&&!(n.spec.group??``).split(` `).includes(`block`)}var km=(e,t)=>Dm.get(e)&&t.length===0?[{type:`paragraph`}]:t;function Am(e,t,n,r){if(!e.name)return[];try{return jm(e,t,n,r)}catch{return[]}}function jm(e,t,n,r){if(!e.name)return[];if(/^h[1-6]$/.test(e.name)){let r=$(e.attributes),i=Object.keys(r);if(i.length===1&&i[0]===`id`){let i=parseInt(e.name[1]??`1`,10),a=e.children.flatMap(e=>e.type===`paragraph`?e.children:[e]);return{type:`heading`,attrs:{level:i,customId:r.id},content:a.flatMap(e=>n(e,t)).filter(Boolean)}}}if(e.name===`img`)return om(e);if(e.name===`video`)return cm(e);if(e.name===`Frame`){let n=$(e.attributes);return{type:O.frame,attrs:$p(n,an),content:km(O.frame,r(e,t))}}let i=Ot.includes(e.name);if(e.name===O.steps)return Lm(e,t,n,r);if(e.name===O.accordion)return zm(e,t,n,r);if(e.name===O.accordionGroup)return{type:O.accordionGroup,attrs:Object.assign(Object.assign({},Em($(e.attributes),O.accordionGroup)),t.hasGroupParent&&{__hasGroupParent:!0}),content:r(e,Object.assign(Object.assign({},t),{hasGroupParent:!0}))};if(e.name===O.card)return Bm(e,t,n,r);if([O.tabs,O.codeGroup,O.requestExample,O.responseExample].includes(e.name))return Vm(e,t,n,r);if(e.name===O.columns)return Hm(e,t,r);if(e.name===O.color)return Wm(e);if(e.name===O.tree)return Km(e);if(e.name===O.database)return Jm(e,t);let a=i?O.callout:e.name;if((i||e.name!==O.step&&Object.values(O).includes(e.name))&&(t.hasGroupParent||!Om(a,t.schema??wn))){let n=$(e.attributes);return{type:a,attrs:Object.assign(Object.assign({},i?nm(e.name,n):Em(n,a)),t.hasGroupParent&&{__hasGroupParent:!0}),content:km(a,r(e,t))}}return e.name===`table`&&!$m(e)&&!Zm(e)&&!Qm(e)?eh(e,t,n,r):kt.has(e.name)?{type:O.staticHTML,attrs:{tagName:e.name,attributes:$(e.attributes),mdxJsxNode:$n(e,t)},content:r(e,Object.assign(Object.assign({},t),{hasStaticHtmlParent:!0}))}:e.name===`Prompt`?bm(e,t,n):At.has(e.name)?{type:O.customComponent,attrs:{name:e.name,attributes:$(e.attributes)},content:r(e,t)}:{type:O.unknownTag,attrs:{mdxJsxNode:e}}}function Mm(e){let t=e.children.flatMap(e=>e.type!==`paragraph`||!Pm(e.children)?e:e.children.filter(e=>e.type===`mdxJsxTextElement`).map(e=>Object.assign(Object.assign({},e),{type:`mdxJsxFlowElement`})));return Object.assign(Object.assign({},e),{children:t})}function Nm(e,t){return Mm(e).children.filter(e=>e.type===`mdxJsxFlowElement`&&(t===void 0||e.name===t))}function Pm(e){return e.every(e=>e.type===`mdxJsxTextElement`&&Fm(e.name)||e.type===`text`&&e.value.trim()===``)}function Fm(e){return!!e&&!kt.has(e)&&!jt.has(e)}function Im(e,t,n,r){let i=typeof t==`string`&&t?pe(t).flatMap(e=>r(e,n)):[];return Object.assign({type:e},i.length>0?{content:i}:{})}function Lm(e,t,n,r){let i=Mm(e).children,a=[];for(let t of i)if(t.type!==`text`||t.value.trim()!==``){if(t.type!==`mdxJsxFlowElement`||t.name!==O.step)return{type:O.unknownTag,attrs:{mdxJsxNode:e}};a.push(t)}let o=a.map((e,i)=>Rm(e,t,n,r,{index:i,isLast:i===a.length-1}));return{type:O.steps,attrs:Object.assign(Object.assign({},$p($(e.attributes),[])),t.hasGroupParent&&{__hasGroupParent:!0}),content:o}}function Rm(e,t,n,r,i){let a=$(e.attributes),o=a.title,s=r(e,t);return{type:O.step,attrs:Object.assign(Object.assign(Object.assign({},$p(a,Yt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),{__childIndex:i.index,__isLastInGroup:i.isLast}),content:[Im(O.stepTitle,o,t,n),{type:O.stepBody,content:s.length>0?s:[{type:`paragraph`}]}]}}function zm(e,t,n,r){let i=$(e.attributes),a=i.title,o=r(e,t),s=Im(O.accordionTitle,a,t,n),c={type:O.accordionBody,content:o.length>0?o:[{type:`paragraph`}]};return{type:O.accordion,attrs:Object.assign(Object.assign({},$p(i,Qt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),content:[s,c]}}function Bm(e,t,n,r){let i=$(e.attributes),a=i.title,o=r(e,t),s=Im(O.cardTitle,a,t,n),c={type:O.cardBody,content:o.length>0?o:[{type:`paragraph`}]};return{type:O.card,attrs:Object.assign(Object.assign({},$p(i,Xt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),content:[s,c]}}function Vm(e,t,n,r){let i={[O.tabs]:O.tab,[O.codeGroup]:O.codeBlock,[O.requestExample]:O.codeBlock,[O.responseExample]:O.codeBlock},a=e.children.filter(e=>e.type===`code`),o=t=>e.name===O.tabs?$p(t,tn):$p(t,[]);if(a.length>0)return{type:e.name??O.codeGroup,attrs:Object.assign(Object.assign({},o($(e.attributes))),t.hasGroupParent&&{__hasGroupParent:!0}),content:a.map((e,r)=>{let i=n(e,Object.assign(Object.assign({},t),{hasGroupParent:!0,isHidden:r!==0}));return Array.isArray(i)?i[0]??{type:`paragraph`}:i})};let s=Nm(e);if(s.length>0){let n=i[e.name??``]??O.tab,a=e=>n===O.tab?$p(e,en):e,c=s.map((i,o)=>({type:n,attrs:Object.assign(Object.assign({},a($(i.attributes))),{__isHidden:o!==0,__hasGroupParent:!0}),content:km(n,r(i,Object.assign(Object.assign({},t),{hasGroupParent:e.name!==O.tabs,isHidden:e.name!==O.tabs&&o!==0})))}));return{type:e.name??O.tabs,attrs:Object.assign(Object.assign({},o($(e.attributes))),t.hasGroupParent&&{__hasGroupParent:!0}),content:c}}return r(e,t).length>0?{type:O.unknownTag,attrs:{mdxJsxNode:e}}:{type:e.name??O.tabs,attrs:o($(e.attributes)),content:[]}}function Hm(e,t,n){let r=$p($(e.attributes),Zt),i=n(e,Object.assign(Object.assign({},t),{hasGroupParent:!0})).map(e=>e.type===O.column?Object.assign(Object.assign({},e),{content:km(O.column,e.content??[])}):e);return{type:O.columns,attrs:Object.assign(Object.assign({},r),t.hasGroupParent&&{__hasGroupParent:!0}),content:i}}function Um(e){let t=$(e.attributes),n=t.__namedExpressionAttributes;return{type:`item`,name:typeof t.name==`string`?t.name:void 0,value:t.value,rawValueExpr:n?.value}}function Wm(e){let t=$(e.attributes),n=typeof t.variant==`string`?t.variant:null,r=$p(t,[],[`variant`]),i=Nm(e).map(e=>{if(e.name===`Color.Item`)return Um(e);if(e.name===`Color.Row`){let t=$(e.attributes),n=Nm(e,`Color.Item`).map(Um);return{type:`row`,title:typeof t.title==`string`?t.title:void 0,items:n}}return null}).filter(e=>e!==null);return{type:O.color,attrs:Object.assign({variant:n,colorData:i},r)}}function Gm(e){return Nm(e).map(e=>{if(e.name===`Tree.File`){let t=$(e.attributes);return{type:`file`,name:typeof t.name==`string`?t.name:void 0}}if(e.name===`Tree.Folder`){let t=$(e.attributes);return{type:`folder`,name:typeof t.name==`string`?t.name:void 0,defaultOpen:typeof t.defaultOpen==`boolean`?t.defaultOpen:void 0,openable:typeof t.openable==`boolean`?t.openable:void 0,children:Gm(e)}}return null}).filter(e=>e!==null)}function Km(e){let t=$p($(e.attributes),[]);return{type:O.tree,attrs:Object.assign({treeData:Gm(e)},t)}}var qm=[`view`,`sort`,`filter`,`groupBy`,`calendarBy`];function Jm(e,t){let n=zn(e.attributes),r=$(Bn(e.attributes));return t.databases===!0&&n!==Mn&&(t.schema??wn).nodes[O.database]&&e.children.length===0&&!(Up in r)&&!(Wp in r)&&On(r.id)&&qm.every(e=>r[e]===void 0||typeof r[e]==`string`)?{type:O.database,attrs:Object.assign(Object.assign({},$p(r,ln)),{sql:n})}:{type:O.unknownTag,attrs:{mdxJsxNode:e}}}var Ym=/* @__PURE__ */ new Set([`colspan`,`colSpan`,`rowspan`,`rowSpan`]),Xm=/* @__PURE__ */ new Set([`class`,`className`]);function Zm(e){return e.attributes.some(e=>e.type===`mdxJsxAttribute`&&Xm.has(e.name))}function Qm(e){return nh(e.children).some(e=>(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&(e.name===`tfoot`||e.name===`caption`||e.name===`thead`&&rh(e.children,`tr`).length>1))}function $m(e){return uh(e)&&e.attributes.some(e=>e.type===`mdxJsxAttribute`&&Ym.has(e.name))?!0:`children`in e&&e.children.some(e=>$m(e))}function eh(e,t,n,r){let i=[];for(let t of nh(e.children))ch(t)?i.push(t):(th(t,`thead`)||th(t,`tbody`))&&i.push(...nh(t.children).filter(ch));if(i.length===0)return{type:`table`,content:[]};let a=oh(e);return{type:`table`,content:i.map((e,i)=>({type:`tableRow`,content:lh(e).map((e,o)=>{let s=e.name===`th`||i===0,c=a[o],l=$(e.attributes).style,u=(typeof l==`string`?l:l&&typeof l==`object`?Object.entries(l).map(([e,t])=>`${e}: ${String(t)}`).join(`; `):``).match(/text(?:-align|Align):\s*(left|center|right)/i),d=dh(e,t,n,r);return{type:s?`tableHeader`:`tableCell`,attrs:{align:u?.[1]??null,colwidth:c?[c]:null},content:d.length>0?d:[{type:`paragraph`}]}})}))}}function th(e,t){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===t}function nh(e){return e.flatMap(e=>e.type===`paragraph`?e.children:[e])}function rh(e,t){return nh(e).filter(e=>th(e,t))}function ih(e){let t=$(e.attributes),n=t.style,r=typeof n==`string`?n.match(/(?:^|;)\s*width:\s*([^;]+)/i)?.[1]:n&&typeof n==`object`?n.width:void 0,i=t.width??r;if(typeof i==`number`)return i>0?i:null;if(typeof i!=`string`)return null;let a=i.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/),o=a?.[1]?Number(a[1]):NaN;return o>0?o:null}function ah(e){let t=Number($(e.attributes).span);return Number.isInteger(t)&&t>0?t:1}function oh(e){let t=rh(e.children,`col`);for(let n of rh(e.children,`colgroup`))t.push(...rh(n.children,`col`));return t.flatMap(e=>Array(ah(e)).fill(ih(e)))}function sh(e){return Array.isArray(e)?e.filter(Boolean):[e]}function ch(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`tr`}function lh(e){let t=[];for(let n of e.children)if(uh(n))t.push(n);else if(n.type===`paragraph`)for(let e of n.children)uh(e)&&t.push(e);return t}function uh(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&(e.name===`td`||e.name===`th`)}function dh(e,t,n,r){let i=[];for(let a of e.children)if(a.type!==`mdxJsxFlowElement`&&a.type!==`mdxJsxTextElement`)i.push(...sh(n(a,t)));else if(a.name===`p`)i.push({type:`paragraph`,content:fh(a,t,n,r)});else if(a.name&&/^h[1-6]$/.test(a.name)){let e=parseInt(a.name[1]??`1`,10),o=$(a.attributes);i.push({type:`heading`,attrs:{level:e,id:o.id??null},content:fh(a,t,n,r)})}else if(a.name===`ul`||a.name===`ol`){let e=a.children.filter(e=>(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`li`).map(e=>({type:`listItem`,content:[{type:`paragraph`,content:fh(e,t,n,r)}]}));e.length>0&&i.push({type:a.name===`ol`?`orderedList`:`bulletList`,attrs:a.name===`ol`?{start:Yp(a.attributes)}:{},content:e})}else i.push(...sh(n(a,t)));return Qn(i,t.schema??wn)}function fh(e,t,n,r){return e.type===`mdxJsxFlowElement`?r(e,t).flatMap(e=>e.type===`paragraph`?e.content??[]:[e]):e.children.flatMap(e=>sh(n(e,t)))}function ph(e,t,n){if(e.name===`Tooltip`){let r=$p($(e.attributes),rn),i=n(e,t);return{type:O.tooltip,attrs:r,content:i.length>0?i:[]}}if(e.name===`img`)return om(e,!0);if(e.name===`video`)return cm(e);if(e.name===`br`)return{type:`hardBreak`};if(e.name===`kbd`){let{text:t}=Yn(e);return Jn(t,[{type:`kbd`}])}if(e.name===`Icon`)return{type:O.icon,attrs:$p($(e.attributes),dn)};if(e.name===`Badge`){let t=$p($(e.attributes),nn),{text:n}=Yn(e);return{type:O.badge,attrs:t,content:n?[{type:`text`,text:n}]:[]}}if(e.name===`u`||e.name===`sub`||e.name===`sup`){let{text:t}=Yn(e);return{type:`text`,text:t,marks:Xn(e)}}if(e.name&&Ot.includes(e.name))return{type:O.callout,attrs:nm(e.name,$(e.attributes)),content:[{type:`paragraph`,content:n(e,t)}]};if(e.name&&At.has(e.name))return{type:O.customComponent,attrs:{name:e.name,attributes:$(e.attributes)},content:Qn(n(e,t),t.schema??wn)};if(e.name&&kt.has(e.name)){let r=t.schema??wn,i=n(e,Object.assign(Object.assign({},t),{hasStaticHtmlParent:!0})),a=i.some(e=>!Zn(e,r));return{type:a?O.staticHTML:O.inlineStaticHTML,attrs:{tagName:e.name,attributes:$(e.attributes),mdxJsxNode:$n(e,t)},content:a?Qn(i,r):i}}return e.name?{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}}:{type:`paragraph`,content:n(e,t)}}var mh=e=>{let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&/\s/.test(e[r]);)r++;if(r>=n)break;let i=``;for(;r<n&&!/\s/.test(e[r]);){let t=e[r];if(t===`"`||t===`'`){let a=t;for(i+=t,r++;r<n&&e[r]!==a;)e[r]===`\\`&&r+1<n?(i+=e[r]+e[r+1],r+=2):(i+=e[r],r++);r<n&&(i+=e[r],r++)}else if(t===`{`){for(;r<n&&e[r]!==`}`;)i+=e[r],r++;r<n&&(i+=e[r],r++)}else i+=t,r++}i&&t.push(i)}return t},hh=e=>{let t=e.match(/^\{(.*)\}$/);return t?t[1]??``:_h(e)},gh=e=>e.replace(/\\(["'\\])/g,`$1`),_h=e=>{let t=e.match(/^(['"])(.*)\1$/);return t?gh(t[2]??``):e.startsWith(`"`)||e.startsWith(`'`)?e.slice(1):e},vh=e=>{if(!e)return{};let t={},n=mh(e.trim()),r=[];for(let e of n){let n=e.match(/^highlight=(.+)$/);if(n){let e=hh(n[1]??``);e&&(t.highlight=e);continue}let i=e.match(/^\{([\d,\-]+)\}$/);if(i){t.highlight=i[1]??``;continue}let a=e.match(/^focus=(.+)$/);if(a){let e=hh(a[1]??``);e&&(t.focus=e);continue}let o=e.match(/^icon=(.+)$/);if(o){t.icon=_h(o[1]??``);continue}let s=e.match(/^title=(.+)$/);if(s){let e=_h(s[1]??``);e&&(t.filename=e,t.filenameSyntax=`title`)}else e===`expandable`||e===`lines`||e===`wrap`||e===`twoslash`||e===`nocopy`?t[e]=!0:e.includes(`=`)||r.push(e)}return t.filename===void 0&&r.length>0&&(t.filename=r.join(` `)),t};function yh(e){let t=e.split(`
|
|
34
|
+
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Zd(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Vd(t)?``:String.fromCharCode(t)}},Q.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Q.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Pd(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Nd:Pd)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Zd(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Q.readWord=function(){var e=this.readWord1(),t=J.name;return this.keywords.test(e)&&(t=Rd[e]),this.finishToken(t,e)},wf.acorn={Parser:wf,version:`8.8.2`,defaultOptions:nf,Position:$d,SourceLocation:ef,getLineInfo:tf,Node:Kf,TokenType:K,tokTypes:J,keywordTypes:Rd,TokContext:Rf,tokContexts:zf,isIdentifierChar:Pd,isIdentifierStart:Nd,Token:Cp,isNewLine:Vd,lineBreak:zd,lineBreakG:Bd,nonASCIIwhitespace:Ud};var Dp=wt(Dt(),1),Op=wf.extend((0,Dp.default)()),kp=1024;function Ap(e,t){let n=e.type===`CallExpression`&&`callee`in e&&e.callee instanceof Kf?e.callee:e;return n.type===`ParenthesizedExpression`&&n.start===t?n.end:void 0}function jp(e){let t,n=``,r=``,i=e.length*2,a=``;return{parse(e,t={}){return Op.parse(e,Object.assign(Object.assign({},t),{ecmaVersion:t.ecmaVersion??`latest`}))},parseExpressionAt(o,s,c={}){let l=Object.assign(Object.assign({},c),{ecmaVersion:c.ecmaVersion??`latest`}),u=JSON.stringify(Object.assign(Object.assign({},l),{onComment:void 0,onToken:void 0}));if(u!==a&&(r=``,n=``,a=u),s===0&&r.length>o.length&&r.startsWith(o))throw Object.assign(/* @__PURE__ */ SyntaxError(`Unexpected end of expression`),{pos:o.length,raisedAt:o.length});try{let e=Op.parseExpressionAt(o,s,l);return r=``,n=``,e}catch(a){if(s!==0||o.length<kp||!o.trimStart().startsWith(`(`)||!(a instanceof SyntaxError)||!(`raisedAt`in a)||typeof a.raisedAt!=`number`||a.raisedAt<o.length||n!==``&&o.startsWith(n))throw a;n=o,r=``,t??=e.replace(/(\r\n|\r|\n) {1,2}/g,`$1`);let c=t.indexOf(o);if(c>=1&&t[c-1]===`{`&&t[c+o.length]===`}`&&t.indexOf(o,c+1)===-1)try{let e=t.slice(c);if(e.length>i)throw a;i-=e.length;let n=Ap(Op.parseExpressionAt(e,s,Object.assign(Object.assign({},l),{onComment:void 0,onToken:void 0,preserveParens:!0})),o.search(/\S/));n!==void 0&&n>o.length&&(r=e.slice(0,n))}catch{r=``}throw a}}}}var Mp=ne().use(gt).use(mt).use(e,[`yaml`,`toml`]).freeze(),Np=Mp().use(l).freeze();function Pp(e){return e.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/).map((e,t)=>t%2==0?e.replace(/<!--([\s\S]*?)-->/g,(e,t)=>`{/* ${t} */}`):e).join(``)}function Fp(e,t={}){let n=t.omitHtmlComments??!0?Pp(e):e;return{sanitized:n,preprocessed:i(n,{preserveOriginal:!0})}}var Ip=e=>e.children.length===0||e.name===`video`;function Lp(e,t){n(e,e=>{if(!c(e)||!Ip(e))return;let n=e.position?.end.offset;n===void 0||t.endsWith(`/>`,n)||(e.data=Object.assign(Object.assign({},e.data),{closingTag:!0}))})}var Rp=[Yc({singleTilde:!0}),xd({estree:!0}),Jc([`yaml`,`toml`])],zp=[...Rp,Xc({singleDollarTextMath:!0})];function Bp(e,t){let r=Kc(e,{syntax:t?zp:Rp});if(r instanceof Error)return;let i=r;return n(i,[`mdxJsxFlowElement`,`mdxJsxTextElement`],e=>{if(`attributes`in e)for(let t of e.attributes)delete t.position}),i}function Vp(e,t=!0){let n={acorn:jp(e)},r=Bp(e,t)??(t?Np:Mp)().use(gt,n).parse(e);return Lp(r,e),t&&ie(r,e),r}function Hp(e,t={omitHtmlComments:!0}){return Vp(Fp(e,t).preprocessed,t.math)}var Up=`__expressionAttributes`,Wp=`__namedExpressionAttributes`,Gp=`__mintlifyExtraAttrs`,Kp=Symbol(`unsupported-estree`);function qp(e,t){if(!e)return Kp;switch(e.type){case`Literal`:return e.value;case`TemplateLiteral`:return e.expressions.length===0?e.quasis[0]?.value.cooked??``:Kp;case`Identifier`:return t?Kp:e.name===`undefined`?void 0:e.name;case`UnaryExpression`:{let n=qp(e.argument,t);return typeof n==`number`?e.operator===`-`?-n:e.operator===`+`?n:Kp:Kp}case`ArrayExpression`:{let n=[];for(let r of e.elements){if(!r||r.type===`SpreadElement`)return Kp;let e=qp(r,t);if(e===Kp)return Kp;n.push(e)}return n}case`ObjectExpression`:{let n={};for(let r of e.properties){if(r.type!==`Property`||r.computed||r.method||r.kind!==`init`)return Kp;let e=r,i=e.key.type===`Identifier`?e.key.name:e.key.type===`Literal`&&(typeof e.key.value==`string`||typeof e.key.value==`number`)?String(e.key.value):void 0;if(!i)return Kp;let a=e.shorthand?e.key.type===`Identifier`?qp(e.key,t):Kp:qp(e.value,t);if(a===Kp)return Kp;n[i]=a}return n}default:return Kp}}function Jp(e,t,n){let r=t?.body[0],i=qp(r?.type===`ExpressionStatement`?r.expression:void 0,n);return i===Kp?e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e:i}function Yp(e=[]){let t=$(e,{staticOnly:!0}).start;return typeof t==`number`?Number.isInteger(t)?t:1:typeof t==`string`&&/^\s*-?\d+\s*$/.test(t)?Number(t):1}function $(e=[],t={}){let n={},r=[],i={};for(let a of e){if(a.type===`mdxJsxExpressionAttribute`){r.push(a.value);continue}let e=a.value;if(typeof e==`object`&&e){let r=e.value;typeof r==`string`?(i[a.name]=r,n[a.name]=Jp(r,`data`in e?e.data?.estree??void 0:void 0,t.staticOnly??!1)):n[a.name]=r}else e==null?n[a.name]=!0:n[a.name]=e}return r.length>0&&(n[Up]=r),Object.keys(i).length>0&&(n[Wp]=i),n}function Xp(e){try{let[t]=Vp(`<X value={${e}} />`,!1).children;return t?.type!==`mdxJsxFlowElement`||t.attributes.length!==1?e:$(t.attributes).value}catch{return e}}var Zp=/* @__PURE__ */ new Set([`ref`,`key`,`dangerouslySetInnerHTML`]);function Qp(e){let t=e[Wp],n=t&&typeof t==`object`?t:{},r={};for(let[t,i]of Object.entries(e))t!==Up&&t!==Wp&&t!==Gp&&(Zp.has(t)||Ft.has(t)||t in n&&i===n[t]||(r[t]=i));return r}function $p(e,t,n=[]){let r={},i={};for(let[a,o]of Object.entries(e))n.includes(a)||(a===Up||a===Wp||t.some(e=>e.name===a)?r[a]=o:i[a]=o);return Object.keys(i).length>0&&(r[Gp]=i),r}var em=$t.filter(e=>e.name!==`type`);function tm(e){return typeof e==`string`?Ot.find(t=>t.toLowerCase()===e.toLowerCase())??null:null}function nm(e,t){if(e!==`Callout`)return Object.assign({type:e},$p(t,em));let n=tm(t.type);return Object.assign({type:n},$p(t,em,n?[`type`]:[]))}function rm(e){let t=e.split(` `).reverse();for(let[e,n]of Object.entries(Lt))if(t.includes(n))return e}function im(e){if(e&&typeof e==`object`&&`width`in e){let t=e.width;if(typeof t==`string`&&t.endsWith(`%`)){let e=parseInt(t.slice(0,-1),10);if(!isNaN(e))return e}}}var am=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function om(e,t=!1){let n=$(e.attributes),r=n.className,i;typeof r==`string`&&(i=rm(r));let a=n.style,o;am(a)&&(o=im(a));let s=Object.assign(Object.assign({},t?Object.assign({},n):n),{[k]:!0});return{type:O.image,attrs:{imgAttributes:s,align:i,width:o}}}function sm(e){return(e.type===`mdxJsxTextElement`||e.type===`mdxJsxFlowElement`)&&e.name===`source`}function cm(e){if(!e.children.every(e=>sm(e)||e.type===`text`&&e.value.trim()===``))return{type:e.type===`mdxJsxTextElement`?O.inlineUnknownTag:O.unknownTag,attrs:{mdxJsxNode:e}};let t=e.children.filter(sm).map(e=>$(e.attributes)),n=$(e.attributes);return{type:O.video,attrs:{videoAttributes:e.data?.closingTag===!0?Object.assign(Object.assign({},n),{[It]:!0}):n,sources:t.length>0?t:null}}}var lm=/* @__PURE__ */ new Set([`hidden`,`dark:block`]),um=/* @__PURE__ */ new Set([`dark:hidden`]);function dm(e){let t=e.attrs?.imgAttributes;return am(t)?t:null}function fm(e){let t=dm(e)?.className;return typeof t==`string`?t:void 0}function pm(e){if(e.type!==O.image)return!1;let t=fm(e);if(!t)return!1;let n=t.split(/\s+/);return n.includes(`hidden`)&&n.includes(`dark:block`)}function mm(e){if(e.type!==O.image)return!1;let t=fm(e);return t?t.split(/\s+/).includes(`dark:hidden`):!1}function hm(e,t){if(!e)return;let n=t===`dark`?lm:um;return e.split(/\s+/).filter(e=>!n.has(e)).join(` `).trim()||void 0}function gm(e){return Object.entries(e).filter(([e])=>e!==`src`&&e!==`className`).sort(([e],[t])=>e<t?-1:+(e>t))}function _m(e,t,n,r){let i=hm(n,`light`),a=hm(r,`dark`),o=i?.split(/\s+/).filter(e=>e!==`block`).join(` `).trim()||void 0;if(a!==i&&a!==o)return!1;let s=gm(e),c=gm(t);return s.length===c.length&&JSON.stringify(s)===JSON.stringify(c)}function vm(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=e[n+1];if(r&&i){let e,a;pm(r)&&mm(i)?(e=r,a=i):mm(r)&&pm(i)&&(a=r,e=i);let o=e?dm(e):null,s=a?dm(a):null,c=o?.src,l=s?.src;if(e&&a&&o&&s&&typeof c==`string`&&typeof l==`string`&&_m(s,o,fm(a),fm(e))){let r=hm(fm(a),`light`),i=Object.assign({},s);delete i.src,r?i.className=r:delete i.className,t.push({type:O.image,attrs:{imgAttributes:i,lightSrc:l,darkSrc:c,align:a.attrs?.align??e.attrs?.align,width:a.attrs?.width??e.attrs?.width}}),n+=2;continue}}r&&t.push(r),n++}return t}function ym(e){if(!e)return null;if(e.type===`image`)return{type:O.inlineImage,attrs:{imgAttributes:{src:e.url,alt:e.alt??void 0,title:e.title??void 0},width:100}};if(e.type===`mdxJsxTextElement`&&e.name===`img`){let t=$(e.attributes),n=100;if(t.width&&typeof t.width==`number`)n=t.width;else if(am(t.style)){let e=im(t.style);e&&(n=e)}return{type:O.inlineImage,attrs:{imgAttributes:Object.assign(Object.assign({},t),{[k]:!0}),width:n}}}return null}function bm(e,t,n){let r=xm(e,`icon`),i=xm(e,`iconType`),a=Sm(e),o=xm(e,`description`)??``,s=[{type:`paragraph`}];if(o)try{let e=Hp(o);Cm(e);let r=n(e,t),i=!Array.isArray(r)&&r.type===`doc`&&Array.isArray(r.content)?r.content:Array.isArray(r)?r:[r];i.length>0&&(s=i)}catch{s=[{type:`paragraph`,content:[Jn(o)]}]}let c=wm(e,t.source),l=$p($(e.attributes),pn,[`description`])[Gp];return{type:O.promptBlock,attrs:Object.assign({icon:r,iconType:i,actions:a},l?{[Gp]:l}:{}),content:[{type:O.promptDescription,content:s},{type:O.codeBlock,attrs:{language:`text`,__hasGroupParent:!0,__isPromptChild:!0,wrap:!0},content:c?[Jn(c)]:[]}]}}function xm(e,t){let n=$(e.attributes)[t];if(typeof n!=`string`)return;let r=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);if(r?.type===`mdxJsxAttribute`&&r.value!==null&&typeof r.value==`object`&&n===r.value.value){let e=n.trim();if(e.startsWith("`")&&e.endsWith("`"))return e.slice(1,-1).replace(/\\`/g,"`").replace(/\\\$/g,`$`).replace(/\\\\/g,`\\`)}return n}function Sm(e){let t=$(e.attributes,{staticOnly:!0}).actions;return Array.isArray(t)?t.filter(e=>typeof e==`string`):[`copy`]}function Cm(e){n(e,`link`,(e,t,n)=>{if(n&&typeof t==`number`&&e.children.length===1&&e.children[0]?.type===`text`&&e.children[0].value===e.url)return n.children[t]={type:`text`,value:e.url},ae})}function wm(e,t){if(!e.position||!t)return``;let n=e.position.start.offset,r=e.position.end.offset;if(n===void 0||r===void 0)return``;let i=t.slice(n,r),a=i.match(/<\/\s*Prompt\s*>$/);if(!a)return``;let o=-1,s=0,c=!1,l=!1;for(let e=1;e<i.length;e++){let t=i[e]??``,n=i[e-1]??``;if(l)t==="`"&&n!==`\\`&&(l=!1);else if(c)t===c&&n!==`\\`&&(c=!1);else if(t==="`"&&s>0)l=!0;else if(t===`"`||t===`'`)c=t;else if(t===`{`)s++;else if(t===`}`)s--;else if(t===`>`&&s===0){o=e+1;break}}if(o===-1)return``;let u=i.length-a[0].length;return i.slice(o,u).trim()}var Tm={[O.accordion]:Qt,[O.badge]:nn,[O.card]:Xt,[O.codeBlock]:fn,[O.columns]:Zt,[O.expandable]:on,[O.frame]:an,[O.icon]:dn,[O.mermaidBlock]:mn,[O.paramField]:hn,[O.promptBlock]:pn,[O.responseField]:gn,[O.step]:Yt,[O.tab]:en,[O.tabs]:tn,[O.tooltip]:rn,[O.update]:un,[O.visibility]:sn};function Em(e,t){return $p(e,Tm[t]??[])}var Dm=/* @__PURE__ */ new Map([[O.callout,!0],[O.column,!0],[O.expandable,!0],[O.frame,!0],[O.paramField,!0],[`Prompt`,!1],[O.responseField,!0],[O.tab,!0],[O.update,!0],[O.visibility,!1],[O.accordion,!1],[O.accordionGroup,!1],[O.card,!1],[O.codeGroup,!1],[O.columns,!1],[O.requestExample,!1],[O.responseExample,!1],[O.steps,!1],[O.tabs,!1]]);function Om(e,t){let n=t.nodes[e];return!!n&&!n.isInline&&!(n.spec.group??``).split(` `).includes(`block`)}var km=(e,t)=>Dm.get(e)&&t.length===0?[{type:`paragraph`}]:t;function Am(e,t,n,r){if(!e.name)return[];try{return jm(e,t,n,r)}catch{return[]}}function jm(e,t,n,r){if(!e.name)return[];if(/^h[1-6]$/.test(e.name)){let r=$(e.attributes),i=Object.keys(r);if(i.length===1&&i[0]===`id`){let i=parseInt(e.name[1]??`1`,10),a=e.children.flatMap(e=>e.type===`paragraph`?e.children:[e]);return{type:`heading`,attrs:{level:i,customId:r.id},content:a.flatMap(e=>n(e,t)).filter(Boolean)}}}if(e.name===`img`)return om(e);if(e.name===`video`)return cm(e);if(e.name===`Frame`){let n=$(e.attributes);return{type:O.frame,attrs:$p(n,an),content:km(O.frame,r(e,t))}}let i=Ot.includes(e.name);if(e.name===O.steps)return Lm(e,t,n,r);if(e.name===O.accordion)return zm(e,t,n,r);if(e.name===O.accordionGroup)return{type:O.accordionGroup,attrs:Object.assign(Object.assign({},Em($(e.attributes),O.accordionGroup)),t.hasGroupParent&&{__hasGroupParent:!0}),content:r(e,Object.assign(Object.assign({},t),{hasGroupParent:!0}))};if(e.name===O.card)return Bm(e,t,n,r);if([O.tabs,O.codeGroup,O.requestExample,O.responseExample].includes(e.name))return Vm(e,t,n,r);if(e.name===O.columns)return Hm(e,t,r);if(e.name===O.color)return Wm(e);if(e.name===O.tree)return Km(e);if(e.name===O.database)return Jm(e,t);let a=i?O.callout:e.name;if((i||e.name!==O.step&&Object.values(O).includes(e.name))&&(t.hasGroupParent||!Om(a,t.schema??wn))){let n=$(e.attributes);return{type:a,attrs:Object.assign(Object.assign({},i?nm(e.name,n):Em(n,a)),t.hasGroupParent&&{__hasGroupParent:!0}),content:km(a,r(e,t))}}return e.name===`table`&&!$m(e)&&!Zm(e)&&!Qm(e)?eh(e,t,n,r):kt.has(e.name)?{type:O.staticHTML,attrs:{tagName:e.name,attributes:$(e.attributes),mdxJsxNode:$n(e,t)},content:r(e,Object.assign(Object.assign({},t),{hasStaticHtmlParent:!0}))}:e.name===`Prompt`?bm(e,t,n):At.has(e.name)?{type:O.customComponent,attrs:{name:e.name,attributes:$(e.attributes)},content:r(e,t)}:{type:O.unknownTag,attrs:{mdxJsxNode:e}}}function Mm(e){let t=e.children.flatMap(e=>e.type!==`paragraph`||!Pm(e.children)?e:e.children.filter(e=>e.type===`mdxJsxTextElement`).map(e=>Object.assign(Object.assign({},e),{type:`mdxJsxFlowElement`})));return Object.assign(Object.assign({},e),{children:t})}function Nm(e,t){return Mm(e).children.filter(e=>e.type===`mdxJsxFlowElement`&&(t===void 0||e.name===t))}function Pm(e){return e.every(e=>e.type===`mdxJsxTextElement`&&Fm(e.name)||e.type===`text`&&e.value.trim()===``)}function Fm(e){return!!e&&!kt.has(e)&&!jt.has(e)}function Im(e,t,n,r){let i=typeof t==`string`&&t?pe(t).flatMap(e=>r(e,n)):[];return Object.assign({type:e},i.length>0?{content:i}:{})}function Lm(e,t,n,r){let i=Mm(e).children,a=[];for(let t of i)if(t.type!==`text`||t.value.trim()!==``){if(t.type!==`mdxJsxFlowElement`||t.name!==O.step)return{type:O.unknownTag,attrs:{mdxJsxNode:e}};a.push(t)}let o=a.map((e,i)=>Rm(e,t,n,r,{index:i,isLast:i===a.length-1}));return{type:O.steps,attrs:Object.assign(Object.assign({},$p($(e.attributes),[])),t.hasGroupParent&&{__hasGroupParent:!0}),content:o}}function Rm(e,t,n,r,i){let a=$(e.attributes),o=a.title,s=r(e,t);return{type:O.step,attrs:Object.assign(Object.assign(Object.assign({},$p(a,Yt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),{__childIndex:i.index,__isLastInGroup:i.isLast}),content:[Im(O.stepTitle,o,t,n),{type:O.stepBody,content:s.length>0?s:[{type:`paragraph`}]}]}}function zm(e,t,n,r){let i=$(e.attributes),a=i.title,o=r(e,t),s=Im(O.accordionTitle,a,t,n),c={type:O.accordionBody,content:o.length>0?o:[{type:`paragraph`}]};return{type:O.accordion,attrs:Object.assign(Object.assign({},$p(i,Qt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),content:[s,c]}}function Bm(e,t,n,r){let i=$(e.attributes),a=i.title,o=r(e,t),s=Im(O.cardTitle,a,t,n),c={type:O.cardBody,content:o.length>0?o:[{type:`paragraph`}]};return{type:O.card,attrs:Object.assign(Object.assign({},$p(i,Xt,[`title`])),t.hasGroupParent&&{__hasGroupParent:!0}),content:[s,c]}}function Vm(e,t,n,r){let i={[O.tabs]:O.tab,[O.codeGroup]:O.codeBlock,[O.requestExample]:O.codeBlock,[O.responseExample]:O.codeBlock},a=e.children.filter(e=>e.type===`code`),o=t=>e.name===O.tabs?$p(t,tn):$p(t,[]);if(a.length>0)return{type:e.name??O.codeGroup,attrs:Object.assign(Object.assign({},o($(e.attributes))),t.hasGroupParent&&{__hasGroupParent:!0}),content:a.map((e,r)=>{let i=n(e,Object.assign(Object.assign({},t),{hasGroupParent:!0,isHidden:r!==0}));return Array.isArray(i)?i[0]??{type:`paragraph`}:i})};let s=Nm(e);if(s.length>0){let n=i[e.name??``]??O.tab,a=e=>n===O.tab?$p(e,en):e,c=s.map((i,o)=>({type:n,attrs:Object.assign(Object.assign({},a($(i.attributes))),{__isHidden:o!==0,__hasGroupParent:!0}),content:km(n,r(i,Object.assign(Object.assign({},t),{hasGroupParent:e.name!==O.tabs,isHidden:e.name!==O.tabs&&o!==0})))}));return{type:e.name??O.tabs,attrs:Object.assign(Object.assign({},o($(e.attributes))),t.hasGroupParent&&{__hasGroupParent:!0}),content:c}}return r(e,t).length>0?{type:O.unknownTag,attrs:{mdxJsxNode:e}}:{type:e.name??O.tabs,attrs:o($(e.attributes)),content:[]}}function Hm(e,t,n){let r=$p($(e.attributes),Zt),i=n(e,Object.assign(Object.assign({},t),{hasGroupParent:!0})).map(e=>e.type===O.column?Object.assign(Object.assign({},e),{content:km(O.column,e.content??[])}):e);return{type:O.columns,attrs:Object.assign(Object.assign({},r),t.hasGroupParent&&{__hasGroupParent:!0}),content:i}}function Um(e){let t=$(e.attributes),n=t.__namedExpressionAttributes;return{type:`item`,name:typeof t.name==`string`?t.name:void 0,value:t.value,rawValueExpr:n?.value}}function Wm(e){let t=$(e.attributes),n=typeof t.variant==`string`?t.variant:null,r=$p(t,[],[`variant`]),i=Nm(e).map(e=>{if(e.name===`Color.Item`)return Um(e);if(e.name===`Color.Row`){let t=$(e.attributes),n=Nm(e,`Color.Item`).map(Um);return{type:`row`,title:typeof t.title==`string`?t.title:void 0,items:n}}return null}).filter(e=>e!==null);return{type:O.color,attrs:Object.assign({variant:n,colorData:i},r)}}function Gm(e){return Nm(e).map(e=>{if(e.name===`Tree.File`){let t=$(e.attributes);return{type:`file`,name:typeof t.name==`string`?t.name:void 0}}if(e.name===`Tree.Folder`){let t=$(e.attributes);return{type:`folder`,name:typeof t.name==`string`?t.name:void 0,defaultOpen:typeof t.defaultOpen==`boolean`?t.defaultOpen:void 0,openable:typeof t.openable==`boolean`?t.openable:void 0,children:Gm(e)}}return null}).filter(e=>e!==null)}function Km(e){let t=$p($(e.attributes),[]);return{type:O.tree,attrs:Object.assign({treeData:Gm(e)},t)}}var qm=[`view`,`sort`,`filter`,`groupBy`,`calendarBy`];function Jm(e,t){let n=zn(e.attributes),r=$(Bn(e.attributes));return t.databases===!0&&n!==Mn&&(t.schema??wn).nodes[O.database]&&e.children.length===0&&!(Up in r)&&!(Wp in r)&&On(r.id)&&qm.every(e=>r[e]===void 0||typeof r[e]==`string`)?{type:O.database,attrs:Object.assign(Object.assign({},$p(r,ln)),{sql:n})}:{type:O.unknownTag,attrs:{mdxJsxNode:e}}}var Ym=/* @__PURE__ */ new Set([`colspan`,`colSpan`,`rowspan`,`rowSpan`]),Xm=/* @__PURE__ */ new Set([`class`,`className`]);function Zm(e){return e.attributes.some(e=>e.type===`mdxJsxAttribute`&&Xm.has(e.name))}function Qm(e){return nh(e.children).some(e=>(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&(e.name===`tfoot`||e.name===`caption`||e.name===`thead`&&rh(e.children,`tr`).length>1))}function $m(e){return uh(e)&&e.attributes.some(e=>e.type===`mdxJsxAttribute`&&Ym.has(e.name))?!0:`children`in e&&e.children.some(e=>$m(e))}function eh(e,t,n,r){let i=[];for(let t of nh(e.children))ch(t)?i.push(t):(th(t,`thead`)||th(t,`tbody`))&&i.push(...nh(t.children).filter(ch));if(i.length===0)return{type:`table`,content:[]};let a=oh(e);return{type:`table`,content:i.map((e,i)=>({type:`tableRow`,content:lh(e).map((e,o)=>{let s=e.name===`th`||i===0,c=a[o],l=$(e.attributes).style,u=(typeof l==`string`?l:l&&typeof l==`object`?Object.entries(l).map(([e,t])=>`${e}: ${String(t)}`).join(`; `):``).match(/text(?:-align|Align):\s*(left|center|right)/i),d=dh(e,t,n,r);return{type:s?`tableHeader`:`tableCell`,attrs:{align:u?.[1]??null,colwidth:c?[c]:null},content:d.length>0?d:[{type:`paragraph`}]}})}))}}function th(e,t){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===t}function nh(e){return e.flatMap(e=>e.type===`paragraph`?e.children:[e])}function rh(e,t){return nh(e).filter(e=>th(e,t))}function ih(e){let t=$(e.attributes),n=t.style,r=typeof n==`string`?n.match(/(?:^|;)\s*width:\s*([^;]+)/i)?.[1]:n&&typeof n==`object`?n.width:void 0,i=t.width??r;if(typeof i==`number`)return i>0?i:null;if(typeof i!=`string`)return null;let a=i.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/),o=a?.[1]?Number(a[1]):NaN;return o>0?o:null}function ah(e){let t=Number($(e.attributes).span);return Number.isInteger(t)&&t>0?t:1}function oh(e){let t=rh(e.children,`col`);for(let n of rh(e.children,`colgroup`))t.push(...rh(n.children,`col`));return t.flatMap(e=>Array(ah(e)).fill(ih(e)))}function sh(e){return Array.isArray(e)?e.filter(Boolean):[e]}function ch(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`tr`}function lh(e){let t=[];for(let n of e.children)if(uh(n))t.push(n);else if(n.type===`paragraph`)for(let e of n.children)uh(e)&&t.push(e);return t}function uh(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&(e.name===`td`||e.name===`th`)}function dh(e,t,n,r){let i=[];for(let a of e.children)if(a.type!==`mdxJsxFlowElement`&&a.type!==`mdxJsxTextElement`)i.push(...sh(n(a,t)));else if(a.name===`p`)i.push({type:`paragraph`,content:fh(a,t,n,r)});else if(a.name&&/^h[1-6]$/.test(a.name)){let e=parseInt(a.name[1]??`1`,10),o=$(a.attributes);i.push({type:`heading`,attrs:{level:e,id:o.id??null},content:fh(a,t,n,r)})}else if(a.name===`ul`||a.name===`ol`){let e=a.children.filter(e=>(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`li`).map(e=>({type:`listItem`,content:[{type:`paragraph`,content:fh(e,t,n,r)}]}));e.length>0&&i.push({type:a.name===`ol`?`orderedList`:`bulletList`,attrs:a.name===`ol`?{start:Yp(a.attributes)}:{},content:e})}else i.push(...sh(n(a,t)));return Qn(i,t.schema??wn)}function fh(e,t,n,r){return e.type===`mdxJsxFlowElement`?r(e,t).flatMap(e=>e.type===`paragraph`?e.content??[]:[e]):e.children.flatMap(e=>sh(n(e,t)))}function ph(e,t,n){if(e.name===`Tooltip`){let r=$p($(e.attributes),rn),i=n(e,t);return{type:O.tooltip,attrs:r,content:i.length>0?i:[]}}if(e.name===`img`)return om(e,!0);if(e.name===`video`)return cm(e);if(e.name===`br`)return{type:`hardBreak`};if(e.name===`kbd`){let{text:t}=Yn(e);return Jn(t,[{type:`kbd`}])}if(e.name===`Icon`)return{type:O.icon,attrs:$p($(e.attributes),dn)};if(e.name===`Badge`){let t=$p($(e.attributes),nn),{text:n}=Yn(e);return{type:O.badge,attrs:t,content:n?[{type:`text`,text:n}]:[]}}if(e.name===`u`||e.name===`sub`||e.name===`sup`){let{text:t}=Yn(e);return{type:`text`,text:t,marks:Xn(e)}}if(e.name&&Ot.includes(e.name))return{type:O.callout,attrs:nm(e.name,$(e.attributes)),content:[{type:`paragraph`,content:n(e,t)}]};if(e.name&&At.has(e.name))return{type:O.customComponent,attrs:{name:e.name,attributes:$(e.attributes)},content:Qn(n(e,t),t.schema??wn)};if(e.name&&kt.has(e.name)){let r=t.schema??wn,i=n(e,Object.assign(Object.assign({},t),{hasStaticHtmlParent:!0})),a=i.some(e=>!Zn(e,r));return{type:a?O.staticHTML:O.inlineStaticHTML,attrs:{tagName:e.name,attributes:$(e.attributes),mdxJsxNode:$n(e,t)},content:a?Qn(i,r):i}}return e.name?{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}}:{type:`paragraph`,content:n(e,t)}}var mh=e=>{let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&/\s/.test(e[r]);)r++;if(r>=n)break;let i=``;for(;r<n&&!/\s/.test(e[r]);){let t=e[r];if(t===`"`||t===`'`){let a=t;for(i+=t,r++;r<n&&e[r]!==a;)e[r]===`\\`&&r+1<n?(i+=e[r]+e[r+1],r+=2):(i+=e[r],r++);r<n&&(i+=e[r],r++)}else if(t===`{`){for(;r<n&&e[r]!==`}`;)i+=e[r],r++;r<n&&(i+=e[r],r++)}else i+=t,r++}i&&t.push(i)}return t},hh=e=>{let t=e.match(/^\{(.*)\}$/);return t?t[1]??``:_h(e)},gh=e=>e.replace(/\\(["'\\])/g,`$1`),_h=e=>{let t=e.match(/^(['"])(.*)\1$/);return t?gh(t[2]??``):e.startsWith(`"`)||e.startsWith(`'`)?e.slice(1):e},vh=e=>{if(!e)return{};let t={},n=mh(e.trim()),r=[];for(let e of n){let n=e.match(/^highlight=(.+)$/);if(n){let e=hh(n[1]??``);e&&(t.highlight=e);continue}let i=e.match(/^\{([\d,\-]+)\}$/);if(i){t.highlight=i[1]??``;continue}let a=e.match(/^focus=(.+)$/);if(a){let e=hh(a[1]??``);e&&(t.focus=e);continue}let o=e.match(/^icon=(.+)$/);if(o){t.icon=_h(o[1]??``);continue}let s=e.match(/^title=(.+)$/);if(s){let e=_h(s[1]??``);e&&(t.filename=e,t.filenameSyntax=`title`)}else e===`expandable`||e===`lines`||e===`wrap`||e===`twoslash`||e===`nocopy`?t[e]=!0:e.includes(`=`)||r.push(e)}return t.filename===void 0&&r.length>0&&(t.filename=r.join(` `)),t};function yh(e){let t=e.split(`
|
|
35
35
|
`),n=[],r=[],i=[];for(let e=0;e<t.length;e++){let a=t[e]??``,o=a.match(/^(.*?)\s*(?:\/\/|\/\*|#|--|<!--)\s*\[!code \+\+\]\s*(?:\*\/|-->)?\s*$/),s=a.match(/^(.*?)\s*(?:\/\/|\/\*|#|--|<!--)\s*\[!code --\]\s*(?:\*\/|-->)?\s*$/);o?(n.push(e+1),i.push(o[1]??``)):s?(r.push(e+1),i.push(s[1]??``)):i.push(a)}return{cleanedCode:i.join(`
|
|
36
|
-
`),addLines:n,removeLines:r}}function bh(e){if(!e)return[];let t=[],n=e.replace(/[{}[\]]/g,``).split(`,`);for(let e of n){let n=e.trim(),r=n.match(/^(\d+)-(\d+)$/);if(r){let e=parseInt(r[1]??`0`,10),n=parseInt(r[2]??`0`,10);for(let r=e;r<=n;r++)t.push(r)}else{let e=parseInt(n,10);isNaN(e)||t.push(e)}}return t}function xh(e){if(e.length===0)return``;let t=[...new Set(e)].sort((e,t)=>e-t),n=[],r=t[0]??0,i=r;for(let e=1;e<t.length;e++){let a=t[e]??0;a===i+1||(n.push(r===i?String(r):`${r}-${i}`),r=a),i=a}return n.push(r===i?String(r):`${r}-${i}`),n.join(`,`)}function Sh(e){let t=/* @__PURE__ */ new Set([`html`,`xml`,`svg`,`mdx`,`md`,`markdown`]),n=/* @__PURE__ */ new Set([`python`,`ruby`,`bash`,`sh`,`shell`,`zsh`,`yaml`,`yml`,`toml`,`perl`,`r`,`elixir`,`dockerfile`,`makefile`,`cmake`]),r=/* @__PURE__ */ new Set([`sql`,`lua`,`haskell`,`elm`]),i=/* @__PURE__ */ new Set([`css`,`scss`,`sass`,`less`,`stylus`]);return t.has(e)?{open:`<!--`,close:`-->`}:n.has(e)?{open:`#`,close:``}:r.has(e)?{open:`--`,close:``}:i.has(e)?{open:`/*`,close:`*/`}:{open:`//`,close:``}}var Ch=/* @__PURE__ */ new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`ul`,`ol`]);function wh(e){return e.type!==`text`||`value`in e&&typeof e.value==`string`&&e.value.trim()!==``}function Th(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}function Eh(e,t,n){return e.flatMap(e=>{if(e.type===`text`){let{text:t,marks:n}=Yn(e);return[Jn(t,n)]}if(e.type===`image`||e.type===`mdxJsxTextElement`&&e.name===`img`){let t=ym(e);return t?[t]:[]}return Th(n(e,t))}).filter(Boolean)}function Dh(e,t,n){let r=e.findIndex(wh);if(r===-1)return null;let i=e.length-1;for(;i>r&&!wh(e[i]);)i--;return{type:`paragraph`,content:Eh(e.slice(r,i+1),t,n)}}function Oh(e,t,n){if(e.some(e=>e.type===`mdxJsxTextElement`&&e.name!=null&&Ch.has(e.name))){let r=[],i=[],a=()=>{let e=Dh(i,t,n);e&&r.push(e),i=[]};for(let o of e){if(o.type===`mdxJsxTextElement`&&o.name!=null&&Ch.has(o.name)){if(a(),/^h[1-6]$/.test(o.name)){let e=parseInt(o.name[1]??`1`,10);r.push({type:`heading`,attrs:{level:e},content:Eh(o.children,t,n)});continue}if(o.name===`ul`||o.name===`ol`){let e=o.children.filter(e=>e.type===`mdxJsxTextElement`&&e.name===`li`).map(e=>({type:`listItem`,content:[{type:`paragraph`,content:Eh(e.children,t,n)}]}));e.length>0&&r.push({type:o.name===`ol`?`orderedList`:`bulletList`,attrs:o.name===`ol`?{start:Yp(o.attributes)}:{},content:e});continue}}i.push(o)}return a(),r}if(e.every(e=>e.type===`text`||e.type===`emphasis`||e.type===`strong`||e.type===`link`||e.type===`linkReference`||e.type===`inlineCode`||e.type===`delete`||e.type===`image`||e.type===`break`||e.type===`inlineMath`||e.type===`footnoteReference`||e.type===`mdxTextExpression`||e.type===`mdxJsxTextElement`)){let r=Dh(e,t,n);return r?[r]:[]}return e.flatMap(e=>Th(n(e,t)))}function kh(e,t,n,r){let i=t.schema??wn;if(e.children.some(e=>e.type===`image`||e.type===`mdxJsxTextElement`&&e.name===`img`)){if(e.children.some(e=>e.type===`text`||e.type===`emphasis`||e.type===`strong`||e.type===`link`||e.type===`linkReference`||e.type===`inlineCode`||e.type===`delete`||e.type===`mdxJsxTextElement`&&e.name!==`img`)){let r=[];for(let i of e.children)if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=ym(i);e&&r.push(e)}else{let e=n(i,t);Array.isArray(e)?r.push(...e):r.push(e)}return Ah(r,i)}let r=[];for(let i of e.children)if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=n(i,t);Array.isArray(e)?r.push(...e):r.push(e)}return r.length>0?r:[]}let a=r(e,t);return a.every(e=>Zn(e,i))?{type:`paragraph`,content:a}:Ah(a,i)}function Ah(e,t){return Qn(vm(e),t).map(e=>e.type===`paragraph`?jh(e):e).filter(e=>e.type!==`paragraph`||(e.content?.length??0)>0)}function jh(e){let t=[...e.content??[]],n=t[0];n?.type===`text`&&n.text&&!n.marks?.some(e=>e.type===`code`)&&(t[0]=Object.assign(Object.assign({},n),{text:n.text.replace(/^\s+/,``)}));let r=t.length-1,i=t[r];return i?.type===`text`&&i.text&&!i.marks?.some(e=>e.type===`code`)&&(t[r]=Object.assign(Object.assign({},i),{text:i.text.replace(/\s+$/,``)})),Object.assign(Object.assign({},e),{content:t.filter(e=>e.type!==`text`||e.text!==``)})}function Mh(e,t,n){let r=e.children,i=e.align||[],a=r[0]?.children.length??0;return{type:`table`,content:r.map((e,r)=>{let o=e.children.reduce((e,t,n)=>t.children.length>0?Math.max(e,n+1):e,a);return{type:`tableRow`,content:e.children.slice(0,o).map((e,a)=>{let o=Oh(e.children,t,n),s=i[a];return{type:r===0?`tableHeader`:`tableCell`,attrs:{align:s??null},content:o.length>0?o:[{type:`paragraph`,content:[]}]}})}})}}function Nh(e,t){if(e.lang===`mermaid`&&!t.hasGroupParent){if(!e.value)return[];let t=e.meta||``,n=t.match(/placement=["']([^"']+)["']/),r=t.match(/actions=\{(true|false)\}/);return{type:O.mermaidBlock,attrs:{placement:n?.[1]||`bottom-right`,actions:r?r[1]===`true`:null},content:[{type:O.codeBlock,attrs:{language:`text`,__hasGroupParent:!0,__isMermaidChild:!0},content:[Jn(e.value)]}]}}let n=vh(e.meta||``),r=e.lang===`nocopy`;r&&n.nocopy===void 0&&(n.nocopy=!0);let{cleanedCode:i,addLines:a,removeLines:o}=yh(e.value||``),s={};return a.length>0&&(s.add=a),o.length>0&&(s.remove=o),Object.assign({type:O.codeBlock,attrs:Object.assign(Object.assign(Object.assign({language:r?`text`:e.lang||null},n),s),{__isHidden:t.isHidden,__hasGroupParent:t.hasGroupParent})},i?{content:[Jn(i)]}:{})}function Ph(e,t=``,n){let r=n?.schema??wn,i=qn(e),a=/* @__PURE__ */ new Map;o(e,e=>{e.type===`definition`&&!a.has(e.identifier)&&a.set(e.identifier,e);let t=e.type===`mdxJsxTextElement`&&e.name===`Prompt`;e.type!==`list`&&e.type!==`mdxJsxFlowElement`&&!t&&delete e.position});let s=Fh(e,{source:t,frontmatter:i,schema:r,definitions:a,databases:n?.databases===!0}),c=Qn(Array.isArray(s)?s:s.content??[],r),l={type:`doc`,content:c.length>0?c:[]};return{doc:He.fromJSON(r,l),frontmatter:i}}function Fh(e,t){if(!e)return[];switch(e.type){case`root`:return{type:`doc`,content:Bh(e,t)};case`heading`:return{type:`heading`,attrs:{level:e.depth},content:Bh(e,t)};case`paragraph`:return kh(e,t,Fh,Bh);case`text`:return e.value?{type:`text`,text:e.value.replace(/\n/g,` `)}:[];case`blockquote`:{let n=Bh(e,t);return{type:`blockquote`,content:n.length?n:[{type:`paragraph`}]}}case`list`:{let n=e.ordered?{start:e.start??1}:{},r=e.children.map(e=>Fh(e,t));return{type:e.ordered?`orderedList`:`bulletList`,attrs:n,content:r.flat()}}case`listItem`:{let n=Bh(e,t);return{type:`listItem`,attrs:{checked:e.checked??null},content:n[0]?.type===`paragraph`?n:[{type:`paragraph`,content:[]},...n]}}case`table`:return Mh(e,t,Fh);case`tableRow`:case`tableCell`:return[];case`thematicBreak`:return{type:`horizontalRule`};case`break`:return{type:`hardBreak`};case`image`:return{type:O.image,attrs:{imgAttributes:{src:e.url,alt:e.alt??void 0,title:e.title??void 0}}};case`code`:return Nh(e,t);case`emphasis`:case`strong`:case`link`:case`delete`:return Ih(e.children,Xn(e),t);case`linkReference`:{let n=Lh(e,t);return n?Ih(e.children,[n],t):{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}}}case`inlineCode`:{let{text:t,marks:n}=Yn(e);return Jn(t,n)}case`math`:return e.value?{type:O.blockMath,attrs:{expression:e.value}}:[];case`inlineMath`:return e.value?{type:O.inlineMath,attrs:{expression:e.value}}:[];case`yaml`:return[];case`mdxJsxTextElement`:{let n=Rh(e,[],t);if(n)return n;if(!e.name||!Dm.has(e.name)||Om(e.name,t.schema??wn))return ph(e,t,Bh);let r=Am(Object.assign(Object.assign({},e),{type:`mdxJsxFlowElement`,children:e.children.length>0?[{type:`paragraph`,children:e.children}]:[]}),t,Fh,Vh);return(Array.isArray(r)?r:[r]).length>0?r:ph(e,t,Bh)}case`mdxJsxFlowElement`:return Am(e,t,Fh,Vh);case`mdxjsEsm`:return{type:O.mdxJsEsm,attrs:{mdastNode:e}};case`mdxFlowExpression`:return{type:O.unknownTag,attrs:{mdxJsxNode:e,__isHidden:!0}};case`mdxTextExpression`:case`footnoteReference`:return{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}};case`definition`:return{type:O.unknownTag,attrs:{mdxJsxNode:e,__isHidden:!0}};default:return{type:O.unknownTag,attrs:{mdxJsxNode:e}}}}function Ih(e,t,n){let r=[];for(let i of e)if(i.type===`text`)i.value&&r.push(Jn(i.value.replace(/\n/g,` `),t));else if(i.type===`break`)r.push({type:`hardBreak`});else if(i.type===`inlineCode`)r.push(Jn(i.value||``,[...t,{type:`code`}]));else if(i.type===`linkReference`){let e=Lh(i,n);if(e)r.push(...Ih(i.children,[...t,e],n));else{let e=Fh(i,n);r.push(...Array.isArray(e)?e:[e])}}else if(i.type===`emphasis`||i.type===`strong`||i.type===`link`||i.type===`delete`)r.push(...Ih(i.children,[...t,...Xn(i)],n));else if(i.type===`mdxJsxTextElement`&&i.name===`Link`){let e=Rh(i,t,n);if(e)r.push(...e);else{let e=Fh(i,n);r.push(...Array.isArray(e)?e:[e])}}else if(i.type===`mdxJsxTextElement`&&(i.name===`u`||i.name===`sub`||i.name===`sup`))r.push(...Ih(i.children,[...t,...Xn(i)],n));else if(i.type===`mdxJsxTextElement`&&i.name===`kbd`){let{text:e}=Yn(i);e&&r.push(Jn(e,[...t,{type:`kbd`}]))}else if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=ym(i);e&&r.push(t.length>0?Object.assign(Object.assign({},e),{marks:t}):e)}else{let e=Fh(i,n),a=Array.isArray(e)?e:[e],o=i.type===`mdxTextExpression`&&t.length>0?a.map(e=>Object.assign(Object.assign({},e),{marks:t})):a;r.push(...o)}return r}function Lh(e,t){let n=t.definitions?.get(e.identifier);if(n)return{type:`link`,attrs:{href:n.url,title:n.title??void 0,referenceLabel:e.label??n.label??e.identifier}}}function Rh(e,t,n){let r=zh(e,n);if(!r)return;let i=Ih(e.children,[...t,r],n),a=n.schema??wn,o=i.every(e=>{if(!Zn(e,a)||e.type!==`text`&&e.type!==O.inlineImage&&e.type!==O.inlineUnknownTag)return!1;let t=e.marks?.filter(e=>e.type===`link`)??[];return t.length===1&&t[0]?.attrs?.mdxLinkAttributes!==void 0});return i.length>0&&o?i:void 0}function zh(e,t){if(e.name!==`Link`||e.attributes.some(e=>e.type===`mdxJsxExpressionAttribute`))return;let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`href`);if(!n||typeof n.value!=`string`)return;let r=$(e.attributes),i=t.nextMdxLinkId??0;return t.nextMdxLinkId=i+1,{type:`link`,attrs:{href:n.value,title:typeof r.title==`string`?r.title:void 0,mdxLinkAttributes:r,mdxLinkId:i}}}function Bh(e,t){return vm(e.children.flatMap(e=>Fh(e,t)).filter(Boolean))}function Vh(e,t){return Qn(vm(Mm({children:e.children}).children.flatMap(e=>e.type===`mdxJsxFlowElement`?Am(e,t,Fh,Vh):Fh(e,t)).filter(Boolean)),t.schema??wn)}function Hh(e,t){return Ph(Hp(e,t),e,t)}var Uh=p().use(mt).use(a,[`yaml`,`toml`]).use(l).freeze(),Wh=/(<\/?(?:aside|details)\b[^>]*>|<summary\b[^>]*>[\s\S]*?<\/summary>)/i,Gh=/^<summary\b[^>]*>([\s\S]*?)<\/summary>$/i,Kh=/<(area|br|col|embed|hr|img|input|source|track|wbr)\b((?:[^>"']|"[^"]*"|'[^']*')*?)\s*\/?>/gi,qh=/^<([a-z][\w-]*)\b[^>]*(?<!\/)>$/i,Jh=/<\/?[a-z][^>]*>/gi,Yh=/* @__PURE__ */ new Set([`paragraph`,`heading`,`tableCell`,`emphasis`,`strong`,`delete`,`link`,`linkReference`]),Xh=e=>`open`in e||`close`in e||`summary`in e,Zh=e=>(e?.type===`mdxJsxFlowElement`||e?.type===`mdxJsxTextElement`)&&e.name===`summary`,Qh=({tag:e,title:t,children:n})=>({type:`mdxJsxFlowElement`,name:e===`aside`?`Callout`:`Accordion`,attributes:e===`details`?[{type:`mdxJsxAttribute`,name:`title`,value:t??``}]:[],children:n});function $h(e){let[t]=e;if(Zh(t))return e.shift(),Yn(t).text.trim();if(t?.type!==`paragraph`||!Zh(t.children[0]))return;let n=t.children.shift();return Yn(t).text.trim()||e.shift(),Yn(n).text.trim()}function eg(e){o(e,`mdxJsxFlowElement`,(e,t,n)=>{if(!n||t===void 0||e.name!==`aside`&&e.name!==`details`)return;let r=e.children,i=e.name===`details`?$h(r):void 0;n.children[t]=Qh({tag:e.name,title:i,children:r})})}var tg=/^\s*\/\*[\s\S]*\*\/\s*$/;function ng(e){o(e,(e,t,n)=>{if(e.type!==`mdxTextExpression`&&e.type!==`mdxFlowExpression`||!n||t===void 0||tg.test(e.value))return;let r={type:`text`,value:`{${e.value}}`};n.children[t]=e.type===`mdxFlowExpression`?{type:`paragraph`,children:[r]}:r})}function rg(e){try{return Hp(e.replace(Kh,`<$1$2 />`)).children}catch{let t=e.replace(Jh,``).trim();return t?[{type:`paragraph`,children:[{type:`text`,value:t}]}]:[]}}function ig(e){return rg(e).flatMap(e=>e.type===`paragraph`?e.children:e.type===`mdxJsxFlowElement`?[Object.assign(Object.assign({},e),{type:`mdxJsxTextElement`})]:[])}function ag(e){let t=e.split(Wh);return t.length===1?rg(e):t.flatMap((e,t)=>{if(t%2==0)return e.trim()?lg(e).children:[];let n=Gh.exec(e);return n?[{summary:(n[1]??``).replace(Jh,``).trim()}]:e.startsWith(`</`)?[{close:!0}]:[{open:/^<aside/i.test(e)?`aside`:`details`}]})}function og(e){let t=[],n=[],r=()=>n.at(-1)?.children??t,i=()=>{let e=n.pop();e&&r().push(Qh(e))};for(let a of e)if(!Xh(a))r().push(a);else if(`open`in a)n.push({tag:a.open,children:[]});else if(`close`in a)i();else{let e=n.at(-1);e?e.title=a.summary:t.push({type:`paragraph`,children:[{type:`text`,value:a.summary}]})}for(;n.length>0;)i();return t}function sg(e,t,n){let r=e[t],i=r?.type===`html`?qh.exec(r.value)?.[1]:void 0,a=(r?.position)?.start.offset;if(!i||a===void 0)return;let o=e.findIndex((e,n)=>n>t&&e.type===`html`&&e.value.toLowerCase()===`</${i}>`.toLowerCase()),s=(e[o]?.position)?.end.offset;if(o!==-1&&s!==void 0)return{nodes:ig(n.slice(a,s)),skip:o-t}}function cg(e,t){let n=Yh.has(e.type),r=[];for(let i=0;i<e.children.length;i++){let a=e.children[i];if(a.type!==`html`)`children`in a&&cg(a,t),r.push(a);else if(!n)r.push(...ag(a.value));else{let n=sg(e.children,i,t);r.push(...n?.nodes??ig(a.value)),i+=n?.skip??0}}e.children=r.some(Xh)?og(r):r}function lg(e){let t=Uh.parse(e);return ae(t,e),cg(t,e),t}function ug(e){try{let t=Hp(e);return eg(t),ng(t),t}catch{return lg(e)}}function dg(e,t){return Ph(ug(e),e,t)}function fg(e){return e!==void 0&&e!==``}function pg(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>fg(t)))}function mg(){let e=/* @__PURE__ */ new Set,t=/* @__PURE__ */ new Set,n=i.shape;for(let[r,i]of Object.entries(n)){let n=i instanceof ne?i.unwrap():i;n instanceof S&&e.add(r),n instanceof re&&t.add(r),n instanceof g&&n.options.every(e=>e instanceof re)&&t.add(r)}return{booleanKeys:e,arrayKeys:t}}var{booleanKeys:hg,arrayKeys:gg}=mg(),_g=Array.from(hg),vg=Array.from(gg);function yg(e){try{return JSON.parse(e)}catch{return e}}var bg=/* @__PURE__ */ new Set([`automerge`]);function xg(e,t){if(hg.has(e)||bg.has(e))return t===`true`;if(gg.has(e)){let e=yg(t);return Array.isArray(e)?e:t}return t}var Sg={lineWidth:-1,quotingType:`"`,forceQuotes:!0},Cg=/* @__PURE__ */ new Set([`background`,`eyebrow`]);function wg(e,t){return Array.isArray(e)?e.map(e=>wg(e)):typeof e==`object`&&e&&!(e instanceof Date)?Object.fromEntries(Object.entries(e).filter(([e,n])=>fg(n)||n===``&&!!t?.has(e)).map(([e,t])=>[e,wg(t)])):e}function Tg(e,t){let n=hg.has(e),r=t;n&&(r===`true`||r===`false`)&&(r=r===`true`),r===void 0&&(r=null);let i=e===`thumbnail`?Cg:void 0;return v.dump({[e]:wg(r,i)},Sg).trimEnd()}function Eg(e){if(!e||!e.startsWith(`<`)||!e.endsWith(`>`))return!1;try{let t=jp(e).parseExpressionAt(e,0,{sourceType:`module`});return t.type===`JSXElement`&&t.end===e.length}catch{return!1}}function Dg(e){return e.textContent}var Og=/^[A-Za-z_$][\w$]*$/;function kg(e){return e==null?null:typeof e==`object`?`{${Array.isArray(e)?Ag(e):jg(e,!0)}}`:typeof e==`string`?e===``?`""`:Eg(e)?`{${e}}`:e.includes(`&`)||e.includes(`"`)&&e.includes(`'`)?`{${JSON.stringify(e)}}`:e.includes(`"`)?`'${e}'`:`"${e}"`:typeof e==`number`||typeof e==`boolean`?`{${e}}`:`{${JSON.stringify(e)}}`}function Ag(e){return e==null?`null`:typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?`[${e.map(Ag).join(`,`)}]`:typeof e==`object`?jg(e,!1):JSON.stringify(e)??`null`}function jg(e,t){let n=Object.entries(e).filter(([,e])=>e!==void 0).map(([e,t])=>`${Og.test(e)?e:JSON.stringify(e)}:${Ag(t)}`);return t?`{ ${n.join(`,`)} }`:`{${n.join(`,`)}}`}function Mg(e,t,n){let r=Bg(e,t);if(r!==void 0)return`${t}={${r}}`;if(n===!0)return t;let i=kg(n);return i?`${t}=${i}`:null}var Ng={"&":`&`,'"':`"`,"<":`<`,">":`>`,"\n":`
`,"\r":`
`,"`":```,"~":`~`},Pg=e=>e.replace(/[&"<>\n\r`~]/g,e=>Ng[e]??e),Fg=Object.assign(Object.assign({},Ng),{"'":`'`,"*":`*`,"{":`{`,"}":`}`}),Ig=/&(?=#?[A-Za-z0-9]+;)|<(?=[A-Za-z/!?])|(?<=\/)\*|\*(?=\/)|[\n\r`~{}]/g;function Lg(e,t){if(typeof t!=`string`)return null;let n=t.includes(`"`)?`'`:`"`;return`${e}=${n}${t.replace(RegExp(`${Ig.source}|${n}`,`g`),e=>Fg[e]??e)}${n}`}function Rg(e,t,n){return typeof n==`string`?`${t}="${Pg(n)}"`:Mg(e,t,n)}var zg=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Bg(e,t){let n=e[Wp];if(!zg(n))return;let r=n[t];return typeof r==`string`?r:void 0}var Vg=/* @__PURE__ */ new Set([`\\`,"`",`*`,`{`,`}`,`<`,`$`]),Hg=/* @__PURE__ */ new Set([`|`,`_`,`[`,`]`,`>`,`+`,`&`]),Ug=RegExp(`[${[...Vg,...Hg].map(e=>`\\${e}`).join(``)}]`),Wg=/[\p{L}\p{N}]/u,Gg=/^\[[ xX]\]/,Kg=/\][([]/,qg=/\]:/,Jg=/^&(?:#[0-9]{1,7}|#x[0-9a-f]{1,6}|[a-z][a-z0-9]{1,31});/i;function Yg(e){return e!==void 0&&Wg.test(e)}var Xg=class{constructor(e={}){this.chunks=[],this.chunkStarts=[],this.outLength=0,this.tail=``,this.trailingSpaces=0,this.topLevelLead=null,this.delim=``,this.closed=!1,this.inTable=!1,this.inHtmlTable=!1,this.inCodeSection=!1,this.keptBlankLines=/* @__PURE__ */ new Set,this.hasReferenceDefinitions=!1,this.indentSize=2,this.sourceMap=null,this.nodePath=[],this.options={tightLists:e.tightLists??!1,indentSize:e.indentSize??2,listIndentSize:e.listIndentSize??0,removeTrailingNewline:e.removeTrailingNewline??!0,hasReferenceDefinitions:e.hasReferenceDefinitions??!1,emphasisMarker:e.emphasisMarker??`_`},this.indentSize=this.options.indentSize,this.hasReferenceDefinitions=this.options.hasReferenceDefinitions}get out(){if(this.chunks.length>1){let e=this.chunks.join(``);this.chunks=[e],this.chunkStarts=[0]}return this.chunks[0]??``}set out(e){this.chunks=[],this.chunkStarts=[],this.outLength=0,this.tail=``,this.trailingSpaces=0,this.append(e)}get length(){return this.outLength}get trailingSpaceCount(){return this.trailingSpaces}sliceFrom(e){let t=0,n=this.chunkStarts.length-1;for(;t<n;){let r=t+n+1>>1;(this.chunkStarts[r]??0)<=e?t=r:n=r-1}let r=this.chunks[t];return r===void 0?``:r.slice(e-(this.chunkStarts[t]??0))+this.chunks.slice(t+1).join(``)}truncate(e){let t=e;for(;t>0&&this.chunks.length>0;){let e=this.chunks[this.chunks.length-1]??``;e.length<=t?(t-=e.length,this.chunks.pop(),this.chunkStarts.pop()):(this.chunks[this.chunks.length-1]=e.slice(0,e.length-t),t=0)}this.outLength-=e-t,this.tail=``,this.trailingSpaces=0;for(let e=this.chunks.length-1;e>=0&&this.tail.length<2;e--)this.tail=((this.chunks[e]??``)+this.tail).slice(-2);for(let e=this.chunks.length-1;e>=0;e--){let t=this.chunks[e]??``,n=t.length;for(;n>0&&t.charCodeAt(n-1)===32;)n--;if(this.trailingSpaces+=t.length-n,n>0)break}}append(e){if(e.length===0)return;this.chunkStarts.push(this.outLength),this.chunks.push(e),this.outLength+=e.length,this.tail=(this.tail+e).slice(-2);let t=e.length;for(;t>0&&e.charCodeAt(t-1)===32;)t--;this.trailingSpaces=t===0?this.trailingSpaces+e.length:e.length-t;let n=this.topLevelLead;if(n&&!n.content){let t=0;for(;t<e.length&&e.charCodeAt(t)===10;)t++;n.lead+=t,t<e.length&&(n.content=!0)}}beginBlock(e){return this.sourceMap?(this.nodePath.push(e),this.nodePath.length===1&&(this.topLevelLead={lead:0,content:!1}),this.outLength):0}endBlock(e){if(this.sourceMap){if(this.nodePath.length===1){let t=this.topLevelLead?.lead??0;this.topLevelLead=null,this.sourceMap.push({path:[...this.nodePath],start:e+t,end:this.outLength,kind:`block`})}this.nodePath.pop()}}recordTextSuffix(e,t,n,r){this.sourceMap&&!this.inTable&&this.sourceMap.push({path:[...this.nodePath,e],start:this.outLength-t,end:this.outLength,kind:`text`,pmStart:n,pmEnd:r})}takeTextSuffix(e){if(!this.sourceMap||e===0)return null;let t=this.sourceMap.at(-1);if(t?.kind!==`text`||t.end!==this.outLength||t.end-t.start<e||t.pmEnd-t.pmStart<e)return null;let n=Object.assign({path:[...t.path],kind:`text`,pmStart:t.pmEnd-e,pmEnd:t.pmEnd},t.offsetEncoding&&{offsetEncoding:t.offsetEncoding});return t.end-=e,t.pmEnd-=e,t.start===t.end&&this.sourceMap.pop(),n}recordTextRange(e,t,n){this.sourceMap&&!this.inTable&&this.sourceMap.push(Object.assign(Object.assign({},e),{start:t,end:n}))}withNodePath(e,t){if(!this.sourceMap)return t();this.nodePath.push(e);try{return t()}finally{this.nodePath.pop()}}recordLiteralTextRange(e,t,n,r=0){this.sourceMap&&!this.inTable&&this.sourceMap.push({path:[...this.nodePath,...e],start:t,end:n,kind:`text`,pmStart:r,pmEnd:r+n-t,offsetEncoding:`identity`})}importTextEntries(e,t,n){if(this.sourceMap)for(let r of e)r.kind===`text`&&this.sourceMap.push(Object.assign({path:[...this.nodePath,...t,...r.path],start:n(r.start),end:n(r.end),kind:`text`,pmStart:r.pmStart,pmEnd:r.pmEnd},r.offsetEncoding&&{offsetEncoding:r.offsetEncoding}))}write(e){this.closed&&=(this.append(`
|
|
36
|
+
`),addLines:n,removeLines:r}}function bh(e){if(!e)return[];let t=[],n=e.replace(/[{}[\]]/g,``).split(`,`);for(let e of n){let n=e.trim(),r=n.match(/^(\d+)-(\d+)$/);if(r){let e=parseInt(r[1]??`0`,10),n=parseInt(r[2]??`0`,10);for(let r=e;r<=n;r++)t.push(r)}else{let e=parseInt(n,10);isNaN(e)||t.push(e)}}return t}function xh(e){if(e.length===0)return``;let t=[...new Set(e)].sort((e,t)=>e-t),n=[],r=t[0]??0,i=r;for(let e=1;e<t.length;e++){let a=t[e]??0;a===i+1||(n.push(r===i?String(r):`${r}-${i}`),r=a),i=a}return n.push(r===i?String(r):`${r}-${i}`),n.join(`,`)}function Sh(e){let t=/* @__PURE__ */ new Set([`html`,`xml`,`svg`,`mdx`,`md`,`markdown`]),n=/* @__PURE__ */ new Set([`python`,`ruby`,`bash`,`sh`,`shell`,`zsh`,`yaml`,`yml`,`toml`,`perl`,`r`,`elixir`,`dockerfile`,`makefile`,`cmake`]),r=/* @__PURE__ */ new Set([`sql`,`lua`,`haskell`,`elm`]),i=/* @__PURE__ */ new Set([`css`,`scss`,`sass`,`less`,`stylus`]);return t.has(e)?{open:`<!--`,close:`-->`}:n.has(e)?{open:`#`,close:``}:r.has(e)?{open:`--`,close:``}:i.has(e)?{open:`/*`,close:`*/`}:{open:`//`,close:``}}var Ch=/* @__PURE__ */ new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`ul`,`ol`]);function wh(e){return e.type!==`text`||`value`in e&&typeof e.value==`string`&&e.value.trim()!==``}function Th(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}function Eh(e,t,n){return e.flatMap(e=>{if(e.type===`text`){let{text:t,marks:n}=Yn(e);return[Jn(t,n)]}if(e.type===`image`||e.type===`mdxJsxTextElement`&&e.name===`img`){let t=ym(e);return t?[t]:[]}return Th(n(e,t))}).filter(Boolean)}function Dh(e,t,n){let r=e.findIndex(wh);if(r===-1)return null;let i=e.length-1;for(;i>r&&!wh(e[i]);)i--;return{type:`paragraph`,content:Eh(e.slice(r,i+1),t,n)}}function Oh(e,t,n){if(e.some(e=>e.type===`mdxJsxTextElement`&&e.name!=null&&Ch.has(e.name))){let r=[],i=[],a=()=>{let e=Dh(i,t,n);e&&r.push(e),i=[]};for(let o of e){if(o.type===`mdxJsxTextElement`&&o.name!=null&&Ch.has(o.name)){if(a(),/^h[1-6]$/.test(o.name)){let e=parseInt(o.name[1]??`1`,10);r.push({type:`heading`,attrs:{level:e},content:Eh(o.children,t,n)});continue}if(o.name===`ul`||o.name===`ol`){let e=o.children.filter(e=>e.type===`mdxJsxTextElement`&&e.name===`li`).map(e=>({type:`listItem`,content:[{type:`paragraph`,content:Eh(e.children,t,n)}]}));e.length>0&&r.push({type:o.name===`ol`?`orderedList`:`bulletList`,attrs:o.name===`ol`?{start:Yp(o.attributes)}:{},content:e});continue}}i.push(o)}return a(),r}if(e.every(e=>e.type===`text`||e.type===`emphasis`||e.type===`strong`||e.type===`link`||e.type===`linkReference`||e.type===`inlineCode`||e.type===`delete`||e.type===`image`||e.type===`break`||e.type===`inlineMath`||e.type===`footnoteReference`||e.type===`mdxTextExpression`||e.type===`mdxJsxTextElement`)){let r=Dh(e,t,n);return r?[r]:[]}return e.flatMap(e=>Th(n(e,t)))}function kh(e,t,n,r){let i=t.schema??wn;if(e.children.some(e=>e.type===`image`||e.type===`mdxJsxTextElement`&&e.name===`img`)){if(e.children.some(e=>e.type===`text`||e.type===`emphasis`||e.type===`strong`||e.type===`link`||e.type===`linkReference`||e.type===`inlineCode`||e.type===`delete`||e.type===`mdxJsxTextElement`&&e.name!==`img`)){let r=[];for(let i of e.children)if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=ym(i);e&&r.push(e)}else{let e=n(i,t);Array.isArray(e)?r.push(...e):r.push(e)}return Ah(r,i)}let r=[];for(let i of e.children)if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=n(i,t);Array.isArray(e)?r.push(...e):r.push(e)}return r.length>0?r:[]}let a=r(e,t);return a.every(e=>Zn(e,i))?{type:`paragraph`,content:a}:Ah(a,i)}function Ah(e,t){return Qn(vm(e),t).map(e=>e.type===`paragraph`?jh(e):e).filter(e=>e.type!==`paragraph`||(e.content?.length??0)>0)}function jh(e){let t=[...e.content??[]],n=t[0];n?.type===`text`&&n.text&&!n.marks?.some(e=>e.type===`code`)&&(t[0]=Object.assign(Object.assign({},n),{text:n.text.replace(/^\s+/,``)}));let r=t.length-1,i=t[r];return i?.type===`text`&&i.text&&!i.marks?.some(e=>e.type===`code`)&&(t[r]=Object.assign(Object.assign({},i),{text:i.text.replace(/\s+$/,``)})),Object.assign(Object.assign({},e),{content:t.filter(e=>e.type!==`text`||e.text!==``)})}function Mh(e,t,n){let r=e.children,i=e.align||[],a=r[0]?.children.length??0;return{type:`table`,content:r.map((e,r)=>{let o=e.children.reduce((e,t,n)=>t.children.length>0?Math.max(e,n+1):e,a);return{type:`tableRow`,content:e.children.slice(0,o).map((e,a)=>{let o=Oh(e.children,t,n),s=i[a];return{type:r===0?`tableHeader`:`tableCell`,attrs:{align:s??null},content:o.length>0?o:[{type:`paragraph`,content:[]}]}})}})}}function Nh(e,t){if(e.lang===`mermaid`&&!t.hasGroupParent){if(!e.value)return[];let t=e.meta||``,n=t.match(/placement=["']([^"']+)["']/),r=t.match(/actions=\{(true|false)\}/);return{type:O.mermaidBlock,attrs:{placement:n?.[1]||`bottom-right`,actions:r?r[1]===`true`:null},content:[{type:O.codeBlock,attrs:{language:`text`,__hasGroupParent:!0,__isMermaidChild:!0},content:[Jn(e.value)]}]}}let n=vh(e.meta||``),r=e.lang===`nocopy`;r&&n.nocopy===void 0&&(n.nocopy=!0);let{cleanedCode:i,addLines:a,removeLines:o}=yh(e.value||``),s={};return a.length>0&&(s.add=a),o.length>0&&(s.remove=o),Object.assign({type:O.codeBlock,attrs:Object.assign(Object.assign(Object.assign({language:r?`text`:e.lang||null},n),s),{__isHidden:t.isHidden,__hasGroupParent:t.hasGroupParent})},i?{content:[Jn(i)]}:{})}function Ph(e,t=``,r){let i=r?.schema??wn,a=qn(e),o=/* @__PURE__ */ new Map;n(e,e=>{e.type===`definition`&&!o.has(e.identifier)&&o.set(e.identifier,e);let t=e.type===`mdxJsxTextElement`&&e.name===`Prompt`;e.type!==`list`&&e.type!==`mdxJsxFlowElement`&&!t&&delete e.position});let s=Fh(e,{source:t,frontmatter:a,schema:i,definitions:o,databases:r?.databases===!0}),c=Qn(Array.isArray(s)?s:s.content??[],i),l={type:`doc`,content:c.length>0?c:[]};return{doc:He.fromJSON(i,l),frontmatter:a}}function Fh(e,t){if(!e)return[];switch(e.type){case`root`:return{type:`doc`,content:Bh(e,t)};case`heading`:return{type:`heading`,attrs:{level:e.depth},content:Bh(e,t)};case`paragraph`:return kh(e,t,Fh,Bh);case`text`:return e.value?{type:`text`,text:e.value.replace(/\n/g,` `)}:[];case`blockquote`:{let n=Bh(e,t);return{type:`blockquote`,content:n.length?n:[{type:`paragraph`}]}}case`list`:{let n=e.ordered?{start:e.start??1}:{},r=e.children.map(e=>Fh(e,t));return{type:e.ordered?`orderedList`:`bulletList`,attrs:n,content:r.flat()}}case`listItem`:{let n=Bh(e,t);return{type:`listItem`,attrs:{checked:e.checked??null},content:n[0]?.type===`paragraph`?n:[{type:`paragraph`,content:[]},...n]}}case`table`:return Mh(e,t,Fh);case`tableRow`:case`tableCell`:return[];case`thematicBreak`:return{type:`horizontalRule`};case`break`:return{type:`hardBreak`};case`image`:return{type:O.image,attrs:{imgAttributes:{src:e.url,alt:e.alt??void 0,title:e.title??void 0}}};case`code`:return Nh(e,t);case`emphasis`:case`strong`:case`link`:case`delete`:return Ih(e.children,Xn(e),t);case`linkReference`:{let n=Lh(e,t);return n?Ih(e.children,[n],t):{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}}}case`inlineCode`:{let{text:t,marks:n}=Yn(e);return Jn(t,n)}case`math`:return e.value?{type:O.blockMath,attrs:{expression:e.value}}:[];case`inlineMath`:return e.value?{type:O.inlineMath,attrs:{expression:e.value}}:[];case`yaml`:return[];case`mdxJsxTextElement`:{let n=Rh(e,[],t);if(n)return n;if(!e.name||!Dm.has(e.name)||Om(e.name,t.schema??wn))return ph(e,t,Bh);let r=Am(Object.assign(Object.assign({},e),{type:`mdxJsxFlowElement`,children:e.children.length>0?[{type:`paragraph`,children:e.children}]:[]}),t,Fh,Vh);return(Array.isArray(r)?r:[r]).length>0?r:ph(e,t,Bh)}case`mdxJsxFlowElement`:return Am(e,t,Fh,Vh);case`mdxjsEsm`:return{type:O.mdxJsEsm,attrs:{mdastNode:e}};case`mdxFlowExpression`:return{type:O.unknownTag,attrs:{mdxJsxNode:e,__isHidden:!0}};case`mdxTextExpression`:case`footnoteReference`:return{type:O.inlineUnknownTag,attrs:{mdxJsxNode:e}};case`definition`:return{type:O.unknownTag,attrs:{mdxJsxNode:e,__isHidden:!0}};default:return{type:O.unknownTag,attrs:{mdxJsxNode:e}}}}function Ih(e,t,n){let r=[];for(let i of e)if(i.type===`text`)i.value&&r.push(Jn(i.value.replace(/\n/g,` `),t));else if(i.type===`break`)r.push({type:`hardBreak`});else if(i.type===`inlineCode`)r.push(Jn(i.value||``,[...t,{type:`code`}]));else if(i.type===`linkReference`){let e=Lh(i,n);if(e)r.push(...Ih(i.children,[...t,e],n));else{let e=Fh(i,n);r.push(...Array.isArray(e)?e:[e])}}else if(i.type===`emphasis`||i.type===`strong`||i.type===`link`||i.type===`delete`)r.push(...Ih(i.children,[...t,...Xn(i)],n));else if(i.type===`mdxJsxTextElement`&&i.name===`Link`){let e=Rh(i,t,n);if(e)r.push(...e);else{let e=Fh(i,n);r.push(...Array.isArray(e)?e:[e])}}else if(i.type===`mdxJsxTextElement`&&(i.name===`u`||i.name===`sub`||i.name===`sup`))r.push(...Ih(i.children,[...t,...Xn(i)],n));else if(i.type===`mdxJsxTextElement`&&i.name===`kbd`){let{text:e}=Yn(i);e&&r.push(Jn(e,[...t,{type:`kbd`}]))}else if(i.type===`image`||i.type===`mdxJsxTextElement`&&i.name===`img`){let e=ym(i);e&&r.push(t.length>0?Object.assign(Object.assign({},e),{marks:t}):e)}else{let e=Fh(i,n),a=Array.isArray(e)?e:[e],o=i.type===`mdxTextExpression`&&t.length>0?a.map(e=>Object.assign(Object.assign({},e),{marks:t})):a;r.push(...o)}return r}function Lh(e,t){let n=t.definitions?.get(e.identifier);if(n)return{type:`link`,attrs:{href:n.url,title:n.title??void 0,referenceLabel:e.label??n.label??e.identifier}}}function Rh(e,t,n){let r=zh(e,n);if(!r)return;let i=Ih(e.children,[...t,r],n),a=n.schema??wn,o=i.every(e=>{if(!Zn(e,a)||e.type!==`text`&&e.type!==O.inlineImage&&e.type!==O.inlineUnknownTag)return!1;let t=e.marks?.filter(e=>e.type===`link`)??[];return t.length===1&&t[0]?.attrs?.mdxLinkAttributes!==void 0});return i.length>0&&o?i:void 0}function zh(e,t){if(e.name!==`Link`||e.attributes.some(e=>e.type===`mdxJsxExpressionAttribute`))return;let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`href`);if(!n||typeof n.value!=`string`)return;let r=$(e.attributes),i=t.nextMdxLinkId??0;return t.nextMdxLinkId=i+1,{type:`link`,attrs:{href:n.value,title:typeof r.title==`string`?r.title:void 0,mdxLinkAttributes:r,mdxLinkId:i}}}function Bh(e,t){return vm(e.children.flatMap(e=>Fh(e,t)).filter(Boolean))}function Vh(e,t){return Qn(vm(Mm({children:e.children}).children.flatMap(e=>e.type===`mdxJsxFlowElement`?Am(e,t,Fh,Vh):Fh(e,t)).filter(Boolean)),t.schema??wn)}function Hh(e,t){return Ph(Hp(e,t),e,t)}var Uh=ne().use(mt).use(e,[`yaml`,`toml`]).use(l).freeze(),Wh=/(<\/?(?:aside|details)\b[^>]*>|<summary\b[^>]*>[\s\S]*?<\/summary>)/i,Gh=/^<summary\b[^>]*>([\s\S]*?)<\/summary>$/i,Kh=/<(area|br|col|embed|hr|img|input|source|track|wbr)\b((?:[^>"']|"[^"]*"|'[^']*')*?)\s*\/?>/gi,qh=/^<([a-z][\w-]*)\b[^>]*(?<!\/)>$/i,Jh=/<\/?[a-z][^>]*>/gi,Yh=/* @__PURE__ */ new Set([`paragraph`,`heading`,`tableCell`,`emphasis`,`strong`,`delete`,`link`,`linkReference`]),Xh=e=>`open`in e||`close`in e||`summary`in e,Zh=e=>(e?.type===`mdxJsxFlowElement`||e?.type===`mdxJsxTextElement`)&&e.name===`summary`,Qh=({tag:e,title:t,children:n})=>({type:`mdxJsxFlowElement`,name:e===`aside`?`Callout`:`Accordion`,attributes:e===`details`?[{type:`mdxJsxAttribute`,name:`title`,value:t??``}]:[],children:n});function $h(e){let[t]=e;if(Zh(t))return e.shift(),Yn(t).text.trim();if(t?.type!==`paragraph`||!Zh(t.children[0]))return;let n=t.children.shift();return Yn(t).text.trim()||e.shift(),Yn(n).text.trim()}function eg(e){n(e,`mdxJsxFlowElement`,(e,t,n)=>{if(!n||t===void 0||e.name!==`aside`&&e.name!==`details`)return;let r=e.children,i=e.name===`details`?$h(r):void 0;n.children[t]=Qh({tag:e.name,title:i,children:r})})}var tg=/^\s*\/\*[\s\S]*\*\/\s*$/;function ng(e){n(e,(e,t,n)=>{if(e.type!==`mdxTextExpression`&&e.type!==`mdxFlowExpression`||!n||t===void 0||tg.test(e.value))return;let r={type:`text`,value:`{${e.value}}`};n.children[t]=e.type===`mdxFlowExpression`?{type:`paragraph`,children:[r]}:r})}function rg(e){try{return Hp(e.replace(Kh,`<$1$2 />`)).children}catch{let t=e.replace(Jh,``).trim();return t?[{type:`paragraph`,children:[{type:`text`,value:t}]}]:[]}}function ig(e){return rg(e).flatMap(e=>e.type===`paragraph`?e.children:e.type===`mdxJsxFlowElement`?[Object.assign(Object.assign({},e),{type:`mdxJsxTextElement`})]:[])}function ag(e){let t=e.split(Wh);return t.length===1?rg(e):t.flatMap((e,t)=>{if(t%2==0)return e.trim()?lg(e).children:[];let n=Gh.exec(e);return n?[{summary:(n[1]??``).replace(Jh,``).trim()}]:e.startsWith(`</`)?[{close:!0}]:[{open:/^<aside/i.test(e)?`aside`:`details`}]})}function og(e){let t=[],n=[],r=()=>n.at(-1)?.children??t,i=()=>{let e=n.pop();e&&r().push(Qh(e))};for(let a of e)if(!Xh(a))r().push(a);else if(`open`in a)n.push({tag:a.open,children:[]});else if(`close`in a)i();else{let e=n.at(-1);e?e.title=a.summary:t.push({type:`paragraph`,children:[{type:`text`,value:a.summary}]})}for(;n.length>0;)i();return t}function sg(e,t,n){let r=e[t],i=r?.type===`html`?qh.exec(r.value)?.[1]:void 0,a=(r?.position)?.start.offset;if(!i||a===void 0)return;let o=e.findIndex((e,n)=>n>t&&e.type===`html`&&e.value.toLowerCase()===`</${i}>`.toLowerCase()),s=(e[o]?.position)?.end.offset;if(o!==-1&&s!==void 0)return{nodes:ig(n.slice(a,s)),skip:o-t}}function cg(e,t){let n=Yh.has(e.type),r=[];for(let i=0;i<e.children.length;i++){let a=e.children[i];if(a.type!==`html`)`children`in a&&cg(a,t),r.push(a);else if(!n)r.push(...ag(a.value));else{let n=sg(e.children,i,t);r.push(...n?.nodes??ig(a.value)),i+=n?.skip??0}}e.children=r.some(Xh)?og(r):r}function lg(e){let t=Uh.parse(e);return ie(t,e),cg(t,e),t}function ug(e){try{let t=Hp(e);return eg(t),ng(t),t}catch{return lg(e)}}function dg(e,t){return Ph(ug(e),e,t)}function fg(e){return e!==void 0&&e!==``}function pg(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>fg(t)))}function mg(){let e=/* @__PURE__ */ new Set,t=/* @__PURE__ */ new Set,n=o.shape;for(let[r,i]of Object.entries(n)){let n=i instanceof C?i.unwrap():i;n instanceof y&&e.add(r),n instanceof te&&t.add(r),n instanceof h&&n.options.every(e=>e instanceof te)&&t.add(r)}return{booleanKeys:e,arrayKeys:t}}var{booleanKeys:hg,arrayKeys:gg}=mg(),_g=Array.from(hg),vg=Array.from(gg);function yg(e){try{return JSON.parse(e)}catch{return e}}var bg=/* @__PURE__ */ new Set([`automerge`]);function xg(e,t){if(hg.has(e)||bg.has(e))return t===`true`;if(gg.has(e)){let e=yg(t);return Array.isArray(e)?e:t}return t}var Sg={lineWidth:-1,quotingType:`"`,forceQuotes:!0},Cg=/* @__PURE__ */ new Set([`background`,`eyebrow`]);function wg(e,t){return Array.isArray(e)?e.map(e=>wg(e)):typeof e==`object`&&e&&!(e instanceof Date)?Object.fromEntries(Object.entries(e).filter(([e,n])=>fg(n)||n===``&&!!t?.has(e)).map(([e,t])=>[e,wg(t)])):e}function Tg(e,t){let n=hg.has(e),r=t;n&&(r===`true`||r===`false`)&&(r=r===`true`),r===void 0&&(r=null);let i=e===`thumbnail`?Cg:void 0;return a.dump({[e]:wg(r,i)},Sg).trimEnd()}function Eg(e){if(!e||!e.startsWith(`<`)||!e.endsWith(`>`))return!1;try{let t=jp(e).parseExpressionAt(e,0,{sourceType:`module`});return t.type===`JSXElement`&&t.end===e.length}catch{return!1}}function Dg(e){return e.textContent}var Og=/^[A-Za-z_$][\w$]*$/;function kg(e){return e==null?null:typeof e==`object`?`{${Array.isArray(e)?Ag(e):jg(e,!0)}}`:typeof e==`string`?e===``?`""`:Eg(e)?`{${e}}`:e.includes(`&`)||e.includes(`"`)&&e.includes(`'`)?`{${JSON.stringify(e)}}`:e.includes(`"`)?`'${e}'`:`"${e}"`:typeof e==`number`||typeof e==`boolean`?`{${e}}`:`{${JSON.stringify(e)}}`}function Ag(e){return e==null?`null`:typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?`[${e.map(Ag).join(`,`)}]`:typeof e==`object`?jg(e,!1):JSON.stringify(e)??`null`}function jg(e,t){let n=Object.entries(e).filter(([,e])=>e!==void 0).map(([e,t])=>`${Og.test(e)?e:JSON.stringify(e)}:${Ag(t)}`);return t?`{ ${n.join(`,`)} }`:`{${n.join(`,`)}}`}function Mg(e,t,n){let r=Bg(e,t);if(r!==void 0)return`${t}={${r}}`;if(n===!0)return t;let i=kg(n);return i?`${t}=${i}`:null}var Ng={"&":`&`,'"':`"`,"<":`<`,">":`>`,"\n":`
`,"\r":`
`,"`":```,"~":`~`},Pg=e=>e.replace(/[&"<>\n\r`~]/g,e=>Ng[e]??e),Fg=Object.assign(Object.assign({},Ng),{"'":`'`,"*":`*`,"{":`{`,"}":`}`}),Ig=/&(?=#?[A-Za-z0-9]+;)|<(?=[A-Za-z/!?])|(?<=\/)\*|\*(?=\/)|[\n\r`~{}]/g;function Lg(e,t){if(typeof t!=`string`)return null;let n=t.includes(`"`)?`'`:`"`;return`${e}=${n}${t.replace(RegExp(`${Ig.source}|${n}`,`g`),e=>Fg[e]??e)}${n}`}function Rg(e,t,n){return typeof n==`string`?`${t}="${Pg(n)}"`:Mg(e,t,n)}var zg=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Bg(e,t){let n=e[Wp];if(!zg(n))return;let r=n[t];return typeof r==`string`?r:void 0}var Vg=/* @__PURE__ */ new Set([`\\`,"`",`*`,`{`,`}`,`<`,`$`]),Hg=/* @__PURE__ */ new Set([`|`,`_`,`[`,`]`,`>`,`+`,`&`]),Ug=RegExp(`[${[...Vg,...Hg].map(e=>`\\${e}`).join(``)}]`),Wg=/[\p{L}\p{N}]/u,Gg=/^\[[ xX]\]/,Kg=/\][([]/,qg=/\]:/,Jg=/^&(?:#[0-9]{1,7}|#x[0-9a-f]{1,6}|[a-z][a-z0-9]{1,31});/i;function Yg(e){return e!==void 0&&Wg.test(e)}var Xg=class{constructor(e={}){this.chunks=[],this.chunkStarts=[],this.outLength=0,this.tail=``,this.trailingSpaces=0,this.topLevelLead=null,this.delim=``,this.closed=!1,this.inTable=!1,this.inHtmlTable=!1,this.inCodeSection=!1,this.keptBlankLines=/* @__PURE__ */ new Set,this.hasReferenceDefinitions=!1,this.indentSize=2,this.sourceMap=null,this.nodePath=[],this.options={tightLists:e.tightLists??!1,indentSize:e.indentSize??2,listIndentSize:e.listIndentSize??0,removeTrailingNewline:e.removeTrailingNewline??!0,hasReferenceDefinitions:e.hasReferenceDefinitions??!1,emphasisMarker:e.emphasisMarker??`_`},this.indentSize=this.options.indentSize,this.hasReferenceDefinitions=this.options.hasReferenceDefinitions}get out(){if(this.chunks.length>1){let e=this.chunks.join(``);this.chunks=[e],this.chunkStarts=[0]}return this.chunks[0]??``}set out(e){this.chunks=[],this.chunkStarts=[],this.outLength=0,this.tail=``,this.trailingSpaces=0,this.append(e)}get length(){return this.outLength}get trailingSpaceCount(){return this.trailingSpaces}sliceFrom(e){let t=0,n=this.chunkStarts.length-1;for(;t<n;){let r=t+n+1>>1;(this.chunkStarts[r]??0)<=e?t=r:n=r-1}let r=this.chunks[t];return r===void 0?``:r.slice(e-(this.chunkStarts[t]??0))+this.chunks.slice(t+1).join(``)}truncate(e){let t=e;for(;t>0&&this.chunks.length>0;){let e=this.chunks[this.chunks.length-1]??``;e.length<=t?(t-=e.length,this.chunks.pop(),this.chunkStarts.pop()):(this.chunks[this.chunks.length-1]=e.slice(0,e.length-t),t=0)}this.outLength-=e-t,this.tail=``,this.trailingSpaces=0;for(let e=this.chunks.length-1;e>=0&&this.tail.length<2;e--)this.tail=((this.chunks[e]??``)+this.tail).slice(-2);for(let e=this.chunks.length-1;e>=0;e--){let t=this.chunks[e]??``,n=t.length;for(;n>0&&t.charCodeAt(n-1)===32;)n--;if(this.trailingSpaces+=t.length-n,n>0)break}}append(e){if(e.length===0)return;this.chunkStarts.push(this.outLength),this.chunks.push(e),this.outLength+=e.length,this.tail=(this.tail+e).slice(-2);let t=e.length;for(;t>0&&e.charCodeAt(t-1)===32;)t--;this.trailingSpaces=t===0?this.trailingSpaces+e.length:e.length-t;let n=this.topLevelLead;if(n&&!n.content){let t=0;for(;t<e.length&&e.charCodeAt(t)===10;)t++;n.lead+=t,t<e.length&&(n.content=!0)}}beginBlock(e){return this.sourceMap?(this.nodePath.push(e),this.nodePath.length===1&&(this.topLevelLead={lead:0,content:!1}),this.outLength):0}endBlock(e){if(this.sourceMap){if(this.nodePath.length===1){let t=this.topLevelLead?.lead??0;this.topLevelLead=null,this.sourceMap.push({path:[...this.nodePath],start:e+t,end:this.outLength,kind:`block`})}this.nodePath.pop()}}recordTextSuffix(e,t,n,r){this.sourceMap&&!this.inTable&&this.sourceMap.push({path:[...this.nodePath,e],start:this.outLength-t,end:this.outLength,kind:`text`,pmStart:n,pmEnd:r})}takeTextSuffix(e){if(!this.sourceMap||e===0)return null;let t=this.sourceMap.at(-1);if(t?.kind!==`text`||t.end!==this.outLength||t.end-t.start<e||t.pmEnd-t.pmStart<e)return null;let n=Object.assign({path:[...t.path],kind:`text`,pmStart:t.pmEnd-e,pmEnd:t.pmEnd},t.offsetEncoding&&{offsetEncoding:t.offsetEncoding});return t.end-=e,t.pmEnd-=e,t.start===t.end&&this.sourceMap.pop(),n}recordTextRange(e,t,n){this.sourceMap&&!this.inTable&&this.sourceMap.push(Object.assign(Object.assign({},e),{start:t,end:n}))}withNodePath(e,t){if(!this.sourceMap)return t();this.nodePath.push(e);try{return t()}finally{this.nodePath.pop()}}recordLiteralTextRange(e,t,n,r=0){this.sourceMap&&!this.inTable&&this.sourceMap.push({path:[...this.nodePath,...e],start:t,end:n,kind:`text`,pmStart:r,pmEnd:r+n-t,offsetEncoding:`identity`})}importTextEntries(e,t,n){if(this.sourceMap)for(let r of e)r.kind===`text`&&this.sourceMap.push(Object.assign({path:[...this.nodePath,...t,...r.path],start:n(r.start),end:n(r.end),kind:`text`,pmStart:r.pmStart,pmEnd:r.pmEnd},r.offsetEncoding&&{offsetEncoding:r.offsetEncoding}))}write(e){this.closed&&=(this.append(`
|
|
37
37
|
`),!1),this.delim&&this.tail.endsWith(`
|
|
38
38
|
`)&&e.length>0&&e[0]!==`
|
|
39
39
|
`&&this.append(this.delim),this.append(e)}ensureNewLine(){this.tail.endsWith(`
|
|
@@ -58,13 +58,13 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
58
58
|
|
|
59
59
|
`);for(let n=0;n<t.childCount;n++){let r=t.child(n);r.type.name===O.codeBlock&&(L_(e,r,[n,0]),n<t.childCount-1&&e.ensureNewLine())}e.ensureNewLine(),e.write(`</${n}>`),e.closeBlock()}function J_(e,t,n){let r=t.attrs.name||`CustomComponent`;r===`CodeBlock`?L_(e,t):K_(e,t,r,t.attrs.attributes??{},n)}function Y_(e,t){let n=Ov(t.attrs),r=Object.assign({},n);r.icon===!0&&delete r.icon;let i=Object.entries(r).map(([e,t])=>!t||Ft.has(e)?null:Mg(r,e,t)).filter(Boolean).join(` `);e.write(`<Icon ${i} />`)}function X_(e,t){let n=Ov(t.attrs),r=Object.entries(n).filter(([e,t])=>Ft.has(e)||t==null?!1:t!==V_[e]).map(([e,t])=>Mg(n,e,t)).filter(Boolean).join(` `),i=Dg(t);i?e.write(`<${O.badge}${r?` ${r}`:``}>${e.esc(i)}</${O.badge}>`):e.write(`<${O.badge}${r?` ${r}`:``} />`)}function Z_(e,t,n){let r=Ov(t.attrs),i=Object.entries(r).filter(([e,t])=>Ft.has(e)||e===`isNewlyCreated`||t==null||t===``?!1:t!==H_[e]).map(([e,t])=>Mg(r,e,t)).filter(Boolean).join(` `);t.childCount>0?(e.write(`<${O.tooltip}${i?` ${i}`:``}>`),n(e,t),e.write(`</${O.tooltip}>`)):e.write(`<${O.tooltip}${i?` ${i}`:``} />`)}var Q_=/* @__PURE__ */ new WeakMap;function $_(e,t){try{let n;return Hh(t,{schema:e.type.schema}).doc.descendants(e=>(n===void 0&&Un.has(e.type.name)&&(n=e.textContent),n===void 0)),n}catch{return}}function ev(e,t,n){return Q_.has(t)||Q_.set(t,$_(e,n)),Q_.get(t)}function tv(e,t,n){if(e.childCount===0&&!e.inlineContent)return!1;let r=ev(e,t,n);return r!==void 0&&r!==e.textContent}function nv(e){return vv([Object.assign(Object.assign({},e),{children:[],data:void 0})]).trim().replace(/^<|\s*\/>$/g,``)}function rv(e,t,n,r){let i=e.inTable||t.type.name===O.inlineStaticHTML,a=t=>e.escapesPipes?t.replace(/\|/g,`|`):t,o=e=>a(e.replace(/\s*\n\s*/g,` `).trim()),s=t.attrs.mdxJsxNode,c;if(s)try{let n=vv([s]);if(!tv(t,s,n)){i?e.write(o(n)):(e.write(n),e.closeBlock());return}s.name&&(c=nv(s),i&&(c=o(c)))}catch{}let l=t.attrs.tagName||`div`,u=t.attrs.attributes??{},d=Object.entries(u).filter(([e,t])=>t!=null).map(([e,t])=>Ft.has(e)?null:Mg(u,e,t)).filter(Boolean),f=Dv(u),p=[...d,...f].join(` `),m=c??(p?`${l} ${p}`:l);t.childCount>0?(e.write(`<${m}>`),i||e.ensureNewLine(),t.inlineContent?r(e,t):n(e,t),e.write(`</${c?s.name:l}>`)):e.write(`<${m} />`),i||e.closeBlock()}var iv=2,av=2,ov=(e,t)=>e.split(`
|
|
60
60
|
`).map((e,n)=>{if(n===0||e===``)return e;if(t>=0)return`${` `.repeat(t)}${e}`;let r=Math.min(-t,e.match(/^ */)?.[0].length??0);return e.slice(r)}).join(`
|
|
61
|
-
`),sv=(e,t)=>{if(e.type===`mdxFlowExpression`){e.value=ov(e.value,iv-av*t);return}if(!(`children`in e))return;let n=e.type===`mdxJsxFlowElement`?t+1:t;for(let t of e.children)sv(t,n)},cv=e=>typeof e==`object`&&!!e&&(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`)&&typeof e.value==`string`;function lv(e,t){let n=t.attrs.mdxJsxNode;if(cv(n))e.write(`{${ov(n.value,iv)}}`),t.type.name===O.unknownTag&&e.closeBlock();else{if(n)try{let r=vv([n]),i=t.type.name===O.inlineUnknownTag?r.replace(/\n$/,``):r;e.write(i)}catch{e.write(`<!-- unknown tag -->`)}t.type.name===O.unknownTag&&e.closeBlock()}}function uv(e,t){let n=t.attrs.mdastNode;if(n)try{let t=vv([n]);e.write(t)}catch{e.write(`<!-- esm node -->`)}e.closeBlock()}var dv=/[\p{L}\p{N}]/u;function fv(e){return e.replace(/\\_/g,(t,n)=>{let r=e[n-1],i=e[n+2];return r!==void 0&&dv.test(r)&&i!==void 0&&dv.test(i)?`_`:t})}var pv=e=>{for(let t of e){let e=t.handlers?.mdxJsxFlowElement??pv(t.extensions??[]);if(e)return e}},mv=e=>
|
|
61
|
+
`),sv=(e,t)=>{if(e.type===`mdxFlowExpression`){e.value=ov(e.value,iv-av*t);return}if(!(`children`in e))return;let n=e.type===`mdxJsxFlowElement`?t+1:t;for(let t of e.children)sv(t,n)},cv=e=>typeof e==`object`&&!!e&&(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`)&&typeof e.value==`string`;function lv(e,t){let n=t.attrs.mdxJsxNode;if(cv(n))e.write(`{${ov(n.value,iv)}}`),t.type.name===O.unknownTag&&e.closeBlock();else{if(n)try{let r=vv([n]),i=t.type.name===O.inlineUnknownTag?r.replace(/\n$/,``):r;e.write(i)}catch{e.write(`<!-- unknown tag -->`)}t.type.name===O.unknownTag&&e.closeBlock()}}function uv(e,t){let n=t.attrs.mdastNode;if(n)try{let t=vv([n]);e.write(t)}catch{e.write(`<!-- esm node -->`)}e.closeBlock()}var dv=/[\p{L}\p{N}]/u;function fv(e){return e.replace(/\\_/g,(t,n)=>{let r=e[n-1],i=e[n+2];return r!==void 0&&dv.test(r)&&i!==void 0&&dv.test(i)?`_`:t})}var pv=e=>{for(let t of e){let e=t.handlers?.mdxJsxFlowElement??pv(t.extensions??[]);if(e)return e}},mv=e=>c(e)&&e.name!==null&&e.children.length===0&&e.data?.closingTag===!0,hv=e=>(t,n,r,i)=>{let a=e(t,n,r,i);return mv(t)?a.replace(/ ?\/>$/,`></${t.name}>`):a},gv=pv(b().use(gt).freeze().data(`toMarkdownExtensions`)??[]),_v=Object.assign({text:(e,t,n,r)=>fv(n.safe(e.value,r)),inlineMath:e=>`$$${e.value}$$`},gv&&{mdxJsxFlowElement:hv(gv),mdxJsxTextElement:hv(gv)});function vv(e){let t=structuredClone(e).map(e=>e?.type===`mdxJsxTextElement`?{type:`paragraph`,children:[e]}:e);for(let e of t)sv(e,0);let n=b().use(gt).use(mt).use(l).use(p,{handlers:_v}).stringify({type:`root`,children:t});return typeof n==`string`?n:String(n)}function yv(e,t){let n=Dg(t),r=n.match(/`{3,}/g),i=r?Math.max(...r.map(e=>e.length))+1:3,a="`".repeat(i),o=``;t.attrs.placement&&t.attrs.placement!==`bottom-right`&&(o+=` placement="${t.attrs.placement}"`),t.attrs.actions===!0?o+=` actions={true}`:t.attrs.actions===!1&&(o+=` actions={false}`),e.write(a+`mermaid`+o+`
|
|
62
62
|
`),e.write(n),e.ensureNewLine(),e.write(a),e.closeBlock()}function bv(e,t,n){let r=t.childCount>0?t.child(0):null,i=t.childCount>1?t.child(1):null,a=``;if(r){let t=new Xg(e.options);n(t,r),a=t.out.trim()}let o=i?Dg(i):``,s=[];if(a){if(a.includes(`&`)){let e=Rg(t.attrs,`description`,a);e&&s.push(e)}else if(a.includes(`"`)){let e=a.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${");s.push(`description={\`${e}\`}`)}else s.push(`description="${a}"`)}t.attrs.icon&&s.push(`icon="${t.attrs.icon}"`),t.attrs.iconType&&s.push(`iconType="${t.attrs.iconType}"`);let c=Array.isArray(t.attrs.actions)?t.attrs.actions:[`copy`];s.push(`actions={[${c.map(e=>`"${e}"`).join(`, `)}]}`);let l=s.length>0?` `+s.join(` `):``;e.write(`<Prompt${l}${kv(t.attrs)}>`),o&&(e.ensureNewLine(),e.write(o)),e.ensureNewLine(),e.write(`</Prompt>`),e.closeBlock()}function xv(e){let t=[];if(e.name){let n=Mg({},`name`,e.name);n&&t.push(n)}if(e.rawValueExpr!==void 0)t.push(`value={${e.rawValueExpr}}`);else if(e.value!==void 0&&e.value!==null){let n=Mg({},`value`,e.value);n&&t.push(n)}return`<Color.Item${t.length?` `+t.join(` `):``} />`}function Sv(e,t){let n=t.attrs.variant,r=t.attrs.colorData??[],i=n?` variant="${n}"`:``;e.write(`<Color${i}${kv(t.attrs)}>`),e.ensureNewLine();let a=e.delim;e.delim+=` `.repeat(e.indentSize);for(let t of r)if(t.type===`row`){let n=t.title?Mg({},`title`,t.title):null;e.write(`<Color.Row${n?` ${n}`:``}>`),e.ensureNewLine();let r=e.delim;e.delim+=` `.repeat(e.indentSize);for(let n of t.items)e.write(xv(n)),e.ensureNewLine();e.delim=r,e.closed=!1,e.ensureNewLine(),e.write(`</Color.Row>`),e.ensureNewLine()}else e.write(xv(t)),e.ensureNewLine();e.delim=a,e.closed=!1,e.ensureNewLine(),e.write(`</Color>`),e.closeBlock()}function Cv(e){let t=[];for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let e=Mg({},n,r);e&&t.push(e)}return t.length?` `+t.join(` `):``}function wv(e,t){if(t.type===`file`){let n=Cv({name:t.name});e.write(`<Tree.File${n} />`),e.ensureNewLine();return}let n=Cv({name:t.name,defaultOpen:t.defaultOpen,openable:t.openable});if(t.children.length===0){e.write(`<Tree.Folder${n} />`),e.ensureNewLine();return}e.write(`<Tree.Folder${n}>`),e.ensureNewLine();let r=e.delim;e.delim+=` `.repeat(e.indentSize);for(let n of t.children)wv(e,n);e.delim=r,e.closed=!1,e.ensureNewLine(),e.write(`</Tree.Folder>`),e.ensureNewLine()}function Tv(e,t){let n=[Mg(t.attrs,`id`,t.attrs.id),...[`view`,`sort`,`filter`,`groupBy`,`calendarBy`].map(e=>Lg(e,t.attrs[e])),typeof t.attrs.sql==`string`?In(t.attrs.sql):null].filter(Boolean),r=n.length>0?` ${n.join(` `)}`:``;e.write(`<Database${r}${kv(t.attrs,Rg)} />`),e.closeBlock()}function Ev(e,t){let n=t.attrs.treeData??[],r=kv(t.attrs);if(n.length===0){e.write(`<Tree${r} />`),e.closeBlock();return}e.write(`<Tree${r}>`),e.ensureNewLine();let i=e.delim;e.delim+=` `.repeat(e.indentSize);for(let t of n)wv(e,t);e.delim=i,e.closed=!1,e.ensureNewLine(),e.write(`</Tree>`),e.closeBlock()}function Dv(e){let t=e[Up];return Array.isArray(t)?t.map(e=>`{${e}}`):[]}function Ov(e){let t=e[Gp];return!t||typeof t!=`object`?e:Object.assign(Object.assign({},e),t)}function kv(e,t=Mg){let n=e[Gp];if(!n||typeof n!=`object`)return``;let r=Object.entries(n);if(r.length===0)return``;let i=r.map(([e,r])=>t(n,e,r)).filter(Boolean);return i.length>0?` `+i.join(` `):``}var Av=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},jv={tightLists:!0,indentSize:2,removeTrailingNewline:!0},Mv=/* @__PURE__ */ new Set([`paragraph`,`heading`,`blockquote`,`bulletList`,`orderedList`,`table`,`horizontalRule`,O.codeBlock,O.image,O.video,O.callout,O.accordion,O.accordionGroup,O.card,O.steps,O.tabs,O.codeGroup,O.columns,O.frame,O.expandable,O.paramField,O.responseField,O.requestExample,O.responseExample,O.customComponent,O.staticHTML,O.unknownTag,O.mdxJsEsm,O.blockMath,O.mermaidBlock,O.promptBlock,O.color,O.tree,O.visibility,O.database]),Nv=/* @__PURE__ */ new Set([`blockquote`,`bulletList`,`orderedList`]),Pv=/* @__PURE__ */ new Set([`image`,O.image]),Fv=/* @__PURE__ */ new Set([`definition`,`footnoteDefinition`]);function Iv(e){let t=!1;return e.descendants(e=>{if(t)return!1;let n=e.attrs.mdxJsxNode;return n?.type&&Fv.has(n.type)&&(t=!0),!t}),t}function Lv(e,t={}){return zv(Bv(e,t,null)).mdx}function Rv(e,t,n){let r=new Xg(t);return r.delim=n,Qv(r,e,e,0),r.out.replace(/(\n[ \t]*)+$/,``)}function zv(e){let t=e.next();for(;!t.done;)t=e.next();return t.value}function*Bv(e,t,n){let{frontmatter:r}=t,i=Av(t,[`frontmatter`]),a=new Xg(Object.assign(Object.assign({},i),{hasReferenceDefinitions:i.hasReferenceDefinitions??Iv(e)}));if(a.sourceMap=n,r&&Object.keys(r).length>0){let e=Object.entries(pg(r));if(e.length>0){a.write(`---
|
|
63
63
|
`);for(let[t,n]of e)a.write(`${Tg(t,n)}
|
|
64
64
|
`);a.write(`---
|
|
65
65
|
|
|
66
66
|
`)}}for(let t=0;t<e.childCount;t++)Hv(a,e,t),yield t+1;let o=a.out;t.removeTrailingNewline!==!1&&o.endsWith(`
|
|
67
|
-
`)&&(o=o.replace(/\n+$/,``));for(let e of n??[])e.end=Math.min(e.end,o.length),e.start=Math.min(e.start,e.end);return{mdx:o,sourceMap:n??[]}}function Vv(e,t,n=0){for(let r=n;r<t.childCount;r++)Hv(e,t,r,n)}function Hv(e,t,n,r=0){let i=t.child(n);if(n>r){e.ensureNewLine();let r=t.child(n-1);Yv(r,i)&&e.ensureNewLine(),Uv(r,i)&&e.keptBlankLines.add(e.length)}let a=e.beginBlock(n);Qv(e,i,t,n),e.endBlock(a)}function Uv(e,t){return Wv(t)?e.type.name===`paragraph`?Wv(e):Pv.has(e.type.name)?u_(e):e.type.name===`table`?D_(e):Nv.has(e.type.name):!1}function Wv(e){return e.type.name===`paragraph`&&e.content.size>0}function Gv(e,t){Vv(e,t,+!!qv(t))}function Kv(e){let t=e.firstChild,n=e.maybeChild(1);return e.type.name===`listItem`&&t?.type.name===`paragraph`&&t.childCount===0&&n!==null&&n.type.name!==`paragraph`}function qv(e){let t=e.maybeChild(1);return Kv(e)&&t!==null&&Jv(e,t)}var Jv=(e,t)=>e.attrs.checked==null||t.type.name===O.image;function Yv(e,t){return Mv.has(e.type.name)||Mv.has(t.type.name)}var Xv={renderInlineImage:(e,t)=>b_(e,t),renderIcon:(e,t)=>Y_(e,t),renderBadge:(e,t)=>X_(e,t),renderTooltip:(e,t)=>Z_(e,t,Zv),renderUnknownTag:(e,t)=>lv(e,t)};function Zv(e,t){n_(e,t,Qv,Xv)}function Qv(e,t,n,r){let i=t.type.name;switch(i){case`doc`:Vv(e,t);break;case`paragraph`:Zv(e,t),e.closeBlock();break;case`heading`:{let n=t.attrs.level||1,r=t.attrs.customId;r&&e.delim?(e.write(`<h${n} id="${r}">`),e.ensureNewLine(),Zv(e,t),e.ensureNewLine(),e.write(`</h${n}>`)):(e.write(`#`.repeat(n)+` `),Zv(e,t),r&&e.write(` {#${r}}`)),e.closeBlock();break}case`blockquote`:w_(e,t,Qv);break;case`bulletList`:T_(e,t,!1,Gv);break;case`orderedList`:T_(e,t,!0,Gv);break;case`horizontalRule`:e.write(`---`),e.closeBlock();break;case`hardBreak`:e.write(`<br />`);break;case`text`:r_(e,t);break;case`table`:E_(e,t,Zv,Qv);break;case O.codeBlock:L_(e,t,[0]);break;case`image`:case O.image:d_(e,t);break;case O.inlineImage:b_(e,t);break;case O.video:x_(e,t);break;case O.callout:U_(e,t,Vv),e.closeBlock();break;case O.card:W_(e,t,`Card`,Vv,Zv),e.closeBlock();break;case O.cardTitle:break;case O.cardBody:Vv(e,t);break;case O.accordion:W_(e,t,`Accordion`,Vv,Zv),e.closeBlock();break;case O.accordionTitle:break;case O.accordionBody:Vv(e,t);break;case O.step:W_(e,t,`Step`,Vv,Zv,[`isLast`]);break;case O.stepTitle:break;case O.stepBody:Vv(e,t);break;case O.column:case O.tab:G_(e,t,i,Vv);break;case O.columns:case O.accordionGroup:case O.steps:case O.tabs:case O.update:case O.frame:case O.expandable:case O.paramField:case O.responseField:case O.visibility:G_(e,t,i,Vv),e.closeBlock();break;case O.codeGroup:case O.requestExample:case O.responseExample:q_(e,t,i);break;case O.customComponent:J_(e,t,Vv),e.closeBlock();break;case O.icon:Y_(e,t);break;case O.badge:X_(e,t);break;case O.tooltip:Z_(e,t,Zv);break;case O.staticHTML:case O.inlineStaticHTML:rv(e,t,Vv,Zv);break;case O.unknownTag:case O.inlineUnknownTag:lv(e,t);break;case O.mdxJsEsm:uv(e,t);break;case O.inlineMath:t.attrs.expression&&e.write(`$$${t.attrs.expression}$$`);break;case O.blockMath:t.attrs.expression&&(e.write(`$$`),e.ensureNewLine(),e.write(String(t.attrs.expression)),e.ensureNewLine(),e.write(`$$`),e.closeBlock());break;case O.color:Sv(e,t);break;case O.tree:Ev(e,t);break;case O.database:Tv(e,t);break;case O.mermaidBlock:yv(e,t);break;case O.promptBlock:bv(e,t,Vv);break;case O.promptDescription:break;case`listItem`:Gv(e,t);break;default:Vv(e,t)}}var $v=(e,t)=>{if(e===t)return!0;if(e.type!==t.type||e.text!==t.text||!ey(e.attrs,t.attrs)||!oy(e.marks,t.marks))return!1;let n=e.content,r=t.content;if(!n&&!r)return!0;if(!n||!r||n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!$v(n[e],r[e]))return!1;return!0},ey=(e,t)=>{if(e===t||!e&&!t)return!0;if(!e||!t)return!1;let n=Object.keys(e).filter(e=>!Nt.has(e)),r=Object.keys(t).filter(e=>!Nt.has(e));if(n.length!==r.length)return!1;for(let r of n)if(!(r===`mdxJsxNode`&&`tagName`in e&&ny(e[r],t[r]))&&ay(r,e[r])!==ay(r,t[r]))return!1;return!0},ty=e=>
|
|
67
|
+
`)&&(o=o.replace(/\n+$/,``));for(let e of n??[])e.end=Math.min(e.end,o.length),e.start=Math.min(e.start,e.end);return{mdx:o,sourceMap:n??[]}}function Vv(e,t,n=0){for(let r=n;r<t.childCount;r++)Hv(e,t,r,n)}function Hv(e,t,n,r=0){let i=t.child(n);if(n>r){e.ensureNewLine();let r=t.child(n-1);Yv(r,i)&&e.ensureNewLine(),Uv(r,i)&&e.keptBlankLines.add(e.length)}let a=e.beginBlock(n);Qv(e,i,t,n),e.endBlock(a)}function Uv(e,t){return Wv(t)?e.type.name===`paragraph`?Wv(e):Pv.has(e.type.name)?u_(e):e.type.name===`table`?D_(e):Nv.has(e.type.name):!1}function Wv(e){return e.type.name===`paragraph`&&e.content.size>0}function Gv(e,t){Vv(e,t,+!!qv(t))}function Kv(e){let t=e.firstChild,n=e.maybeChild(1);return e.type.name===`listItem`&&t?.type.name===`paragraph`&&t.childCount===0&&n!==null&&n.type.name!==`paragraph`}function qv(e){let t=e.maybeChild(1);return Kv(e)&&t!==null&&Jv(e,t)}var Jv=(e,t)=>e.attrs.checked==null||t.type.name===O.image;function Yv(e,t){return Mv.has(e.type.name)||Mv.has(t.type.name)}var Xv={renderInlineImage:(e,t)=>b_(e,t),renderIcon:(e,t)=>Y_(e,t),renderBadge:(e,t)=>X_(e,t),renderTooltip:(e,t)=>Z_(e,t,Zv),renderUnknownTag:(e,t)=>lv(e,t)};function Zv(e,t){n_(e,t,Qv,Xv)}function Qv(e,t,n,r){let i=t.type.name;switch(i){case`doc`:Vv(e,t);break;case`paragraph`:Zv(e,t),e.closeBlock();break;case`heading`:{let n=t.attrs.level||1,r=t.attrs.customId;r&&e.delim?(e.write(`<h${n} id="${r}">`),e.ensureNewLine(),Zv(e,t),e.ensureNewLine(),e.write(`</h${n}>`)):(e.write(`#`.repeat(n)+` `),Zv(e,t),r&&e.write(` {#${r}}`)),e.closeBlock();break}case`blockquote`:w_(e,t,Qv);break;case`bulletList`:T_(e,t,!1,Gv);break;case`orderedList`:T_(e,t,!0,Gv);break;case`horizontalRule`:e.write(`---`),e.closeBlock();break;case`hardBreak`:e.write(`<br />`);break;case`text`:r_(e,t);break;case`table`:E_(e,t,Zv,Qv);break;case O.codeBlock:L_(e,t,[0]);break;case`image`:case O.image:d_(e,t);break;case O.inlineImage:b_(e,t);break;case O.video:x_(e,t);break;case O.callout:U_(e,t,Vv),e.closeBlock();break;case O.card:W_(e,t,`Card`,Vv,Zv),e.closeBlock();break;case O.cardTitle:break;case O.cardBody:Vv(e,t);break;case O.accordion:W_(e,t,`Accordion`,Vv,Zv),e.closeBlock();break;case O.accordionTitle:break;case O.accordionBody:Vv(e,t);break;case O.step:W_(e,t,`Step`,Vv,Zv,[`isLast`]);break;case O.stepTitle:break;case O.stepBody:Vv(e,t);break;case O.column:case O.tab:G_(e,t,i,Vv);break;case O.columns:case O.accordionGroup:case O.steps:case O.tabs:case O.update:case O.frame:case O.expandable:case O.paramField:case O.responseField:case O.visibility:G_(e,t,i,Vv),e.closeBlock();break;case O.codeGroup:case O.requestExample:case O.responseExample:q_(e,t,i);break;case O.customComponent:J_(e,t,Vv),e.closeBlock();break;case O.icon:Y_(e,t);break;case O.badge:X_(e,t);break;case O.tooltip:Z_(e,t,Zv);break;case O.staticHTML:case O.inlineStaticHTML:rv(e,t,Vv,Zv);break;case O.unknownTag:case O.inlineUnknownTag:lv(e,t);break;case O.mdxJsEsm:uv(e,t);break;case O.inlineMath:t.attrs.expression&&e.write(`$$${t.attrs.expression}$$`);break;case O.blockMath:t.attrs.expression&&(e.write(`$$`),e.ensureNewLine(),e.write(String(t.attrs.expression)),e.ensureNewLine(),e.write(`$$`),e.closeBlock());break;case O.color:Sv(e,t);break;case O.tree:Ev(e,t);break;case O.database:Tv(e,t);break;case O.mermaidBlock:yv(e,t);break;case O.promptBlock:bv(e,t,Vv);break;case O.promptDescription:break;case`listItem`:Gv(e,t);break;default:Vv(e,t)}}var $v=(e,t)=>{if(e===t)return!0;if(e.type!==t.type||e.text!==t.text||!ey(e.attrs,t.attrs)||!oy(e.marks,t.marks))return!1;let n=e.content,r=t.content;if(!n&&!r)return!0;if(!n||!r||n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!$v(n[e],r[e]))return!1;return!0},ey=(e,t)=>{if(e===t||!e&&!t)return!0;if(!e||!t)return!1;let n=Object.keys(e).filter(e=>!Nt.has(e)),r=Object.keys(t).filter(e=>!Nt.has(e));if(n.length!==r.length)return!1;for(let r of n)if(!(r===`mdxJsxNode`&&`tagName`in e&&ny(e[r],t[r]))&&ay(r,e[r])!==ay(r,t[r]))return!1;return!0},ty=e=>c(e)&&!!e.name&&kt.has(e.name),ny=(e,t)=>e===null&&ty(t)||t===null&&ty(e),ry=e=>typeof e==`object`&&!!e&&`start`in e&&`end`in e,iy=e=>typeof e==`object`&&!!e&&`start`in e&&`end`in e,ay=(e,t)=>Pt.has(e)?JSON.stringify(t,function(e,t){if(!(e===`position`&&ry(t))&&!(e===`loc`&&iy(t))&&(e!==`start`&&e!==`end`||typeof t!=`number`||typeof this.start!=`number`||typeof this.end!=`number`)&&!(e===`range`&&Array.isArray(t)))return t}):JSON.stringify(t),oy=(e,t)=>{if(e===t||!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.type!==i.type||!ey(r.attrs,i.attrs))return!1}return!0},sy=(e,t)=>{if(e.text!=null)return e.text.length;let n=t.nodes[e.type];if(!n)return 1;if(!e.content||e.content.length===0)return n.spec.content&&n.spec.content.length>0?2:1;let r=2;for(let n of e.content)r+=sy(n,t);return r},cy=e=>e.text==null?e.content?e.content.map(cy).join(``):``:e.text,ly=(e,t)=>{if(e===t||e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let n=Math.min(e.length,t.length),r=Math.max(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i++;let a=i/r,o=new Set(e.toLowerCase().split(/\s+/)),s=new Set(t.toLowerCase().split(/\s+/)),c=0;for(let e of o)s.has(e)&&c++;let l=(/* @__PURE__ */ new Set([...o,...s])).size,u=l>0?c/l:0;return Math.max(a,u)},uy=(e,t,n)=>{if(e.type!==t.type)return!1;if(e.text!=null)return!0;let r=e.type?n.nodes[e.type]:void 0;if(r?.isLeaf)return!0;if(r?.isTextblock){let n=cy(e),r=cy(t);if(n.length===0||r.length===0)return!0;let i=e.type===`heading`&&e.attrs?.level===t.attrs?.level?.15:.3;return ly(n,r)>i}let i=cy(e),a=cy(t);return i.length===0||a.length===0||ly(i,a)>.15},dy=(e,t)=>t.nodes[e]?.isTextblock??!1,fy=(e,t)=>t.nodes[e]?.isLeaf??!1,py=(e,t)=>t.nodes[e]?.spec.code??!1,my=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},hy=/^\s*<h[1-6] id="/,gy=/^\s*<\/h[1-6]>$/,_y=25e6,vy=/^([-*+]|(\d+)([.)]))[ \t]+/,yy=/* @__PURE__ */ new Set([O.card,O.accordion,O.step]),by=/* @__PURE__ */ new Set([`bulletList`,`orderedList`]),xy=/* @__PURE__ */ new Set([O.callout,O.card,O.accordion,O.accordionGroup,O.step,O.steps,O.tab,O.tabs,O.column,O.columns,O.update,O.frame,O.expandable,O.paramField,O.responseField,O.visibility,O.customComponent,O.codeGroup,O.requestExample,O.responseExample]);function Sy(e,t){let{source:n,parseOptions:r,onFallback:i,frontmatter:a}=t,o=my(t,[`source`,`parseOptions`,`onFallback`,`frontmatter`]),s=Object.assign(Object.assign({},o),{frontmatter:a}),c=(t,n,r)=>(i?.(t,n,r),Lv(e,s));try{let t=Ty.create(e,n,r??{},o);if(!t)return c(`unmappable`);let i=t.run(a);return i===null?c(`alignment`):t.roundTrips(i)?i:c(`roundtrip`,i)}catch(e){return c(`error`,void 0,e)}}var Cy=class e{constructor(e,t,n){this.source=e,this.lineMap=n,this.lineStarts=Hy(e),this.origLines=e.split(`
|
|
68
68
|
`),this.preLines=t.split(`
|
|
69
69
|
`)}static create(t,n,r){let i=Uy(n,r);return i?new e(t,r,i):null}lineStart(e){return this.source.lastIndexOf(`
|
|
70
70
|
`,e-1)+1}lineEnd(e){return e+1<this.lineStarts.length?this.lineStarts[e+1]-1:this.source.length}exact(e,t){return this.preLines[e]===this.origLines[t]}span(e){let t=e.position;if(!t)return null;let n=this.lineMap[t.start.line-1],r=this.lineMap[t.end.line-1];if(n===void 0||r===void 0)return null;let i=this.exact(t.start.line-1,n)?this.lineStarts[n]+t.start.column-1:this.lineStarts[n],a=this.exact(t.end.line-1,r)?this.lineStarts[r]+t.end.column-1:this.lineEnd(r);return i>a||a>this.source.length?null:{start:i,end:a}}},wy=class{constructor(e,t,n){this.source=e,this.src=t,this.frame=n,this.out=``,this.first=!0,this.prevSrc=null,this.prevType=null}sep(e,t,n){let{frame:r}=this;if(this.first){this.out+=r.open,n&&r.kind===`jsx`&&!/\n[ \t]*$/.test(r.open)&&(this.out+=`
|
|
@@ -99,4 +99,4 @@ ${d}`,n===void 0?(h+=Vy(e.type.create(null,[s[t]]),this.ser).split(`
|
|
|
99
99
|
`)}}function jy(e,t){let n=/(\r?\n)---[ \t]*$/.exec(e);if(!n)return null;let r=n[1];return`${e.slice(0,n.index)}${r}${t.replace(/\n/g,r)}${e.slice(n.index)}`}function My(e,t,n){let r=jy(e,t);if(r===null||n===void 0)return null;let i=/^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*$/.exec(r)?.[1];if(i===void 0)return null;let a;try{a=(0,se.parse)(i)}catch{return null}if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=ky(a),s=ky(n);if(o.size!==s.size)return null;for(let[e,t]of s)if(o.get(e)!==t)return null;return r}function Ny(e,t,n){n.forEach((r,i)=>{if(r===null)return;let a=e[i].nodes;(!a||a.some((e,n)=>!Py(e,t[r+n])))&&(n[i]=null)})}function Py(e,t){return e.eq(t)||$v(e.toJSON(),t.toJSON())}function Fy(e){if(e.type!==`paragraph`)return[e];let t=e.children.filter(e=>e.type!==`text`||e.value.trim()!==``);return t.length>0&&t.every(e=>e.type===`mdxJsxTextElement`&&Fm(e.name))?t:[e]}var Iy=/* @__PURE__ */ new Set([`emphasis`,`strong`,`delete`,`link`]),Ly=/* @__PURE__ */ new Set([`u`,`sub`,`sup`]);function Ry(e){let t=[];for(let n of e)Iy.has(n.type)&&`children`in n||n.type===`mdxJsxTextElement`&&n.name!==null&&Ly.has(n.name)?t.push(...Ry(n.children)):t.push(n);return t}var zy=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/;function By(e,t,n,r){let i=[],a=t;for(let t=0;t<r.length;t++){if(i.push(a),a>=n)return null;let o=/^[ \t]*\n[ \t\n]*/.exec(e.slice(a,n));if(o){if(r[t]!==` `)return null;a+=o[0].length}else{if(e[a]===`\\`&&a+1<n&&zy.test(e[a+1])&&a++,e[a]!==r[t])return null;a++}}return i.push(a),/^[ \t]*$/.test(e.slice(a,n))?i:null}function Vy(e,t){try{return Lv(e.type.schema.topNodeType.create(null,[e]),Object.assign(Object.assign({},t),{removeTrailingNewline:!0}))}catch{return JSON.stringify(e.toJSON())}}function Hy(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
100
100
|
`&&t.push(n+1);return t}function Uy(e,t){let n=e.split(`
|
|
101
101
|
`),r=t.split(`
|
|
102
|
-
`),i=[],a=0;for(let e=0;e<r.length;)if(r[e]===n[a])i.push(a),a++,e++;else if(hy.test(r[e]??``)&&gy.test(r[e+2]??``))i.push(a,a,a),a++,e+=3;else return null;return a===n.length?i:null}function Wy(e,t){let n=[];e.forEach((e,t)=>{e.keys&&e.keys.length>0&&n.push(t)});let r=n.length,i=t.length;if((r+1)*(i+1)>_y)return null;let a=(e,n)=>{if(n+e.length>i)return!1;for(let r=0;r<e.length;r++)if(t[n+r]!==e[r])return!1;return!0},o=Array.from({length:r+1},()=>new Int32Array(i+1));for(let t=r-1;t>=0;t--){let r=e[n[t]].keys,s=o[t],c=o[t+1];for(let e=i-1;e>=0;e--){let t=Math.max(c[e],s[e+1]);a(r,e)&&(t=Math.max(t,r.length+c[e+r.length])),s[e]=t}}let s=e.map(()=>null),c=0,l=0;for(;c<r&&l<i;){let t=e[n[c]].keys;a(t,l)&&o[c][l]===t.length+o[c+1][l+t.length]?(s[n[c]]=l,c++,l+=t.length):o[c][l]===o[c+1][l]?c++:l++}return s}function Gy(e,t){throw Error(`pmJsonToMdast is not yet implemented — use pmToMdx instead for direct MDX output`)}function Ky(e){let t=
|
|
102
|
+
`),i=[],a=0;for(let e=0;e<r.length;)if(r[e]===n[a])i.push(a),a++,e++;else if(hy.test(r[e]??``)&&gy.test(r[e+2]??``))i.push(a,a,a),a++,e+=3;else return null;return a===n.length?i:null}function Wy(e,t){let n=[];e.forEach((e,t)=>{e.keys&&e.keys.length>0&&n.push(t)});let r=n.length,i=t.length;if((r+1)*(i+1)>_y)return null;let a=(e,n)=>{if(n+e.length>i)return!1;for(let r=0;r<e.length;r++)if(t[n+r]!==e[r])return!1;return!0},o=Array.from({length:r+1},()=>new Int32Array(i+1));for(let t=r-1;t>=0;t--){let r=e[n[t]].keys,s=o[t],c=o[t+1];for(let e=i-1;e>=0;e--){let t=Math.max(c[e],s[e+1]);a(r,e)&&(t=Math.max(t,r.length+c[e+r.length])),s[e]=t}}let s=e.map(()=>null),c=0,l=0;for(;c<r&&l<i;){let t=e[n[c]].keys;a(t,l)&&o[c][l]===t.length+o[c+1][l+t.length]?(s[n[c]]=l,c++,l+=t.length):o[c][l]===o[c+1][l]?c++:l++}return s}function Gy(e,t){throw Error(`pmJsonToMdast is not yet implemented — use pmToMdx instead for direct MDX output`)}function Ky(e){let t=b().use(gt).use(mt).use(l).use(p).stringify(e);return typeof t==`string`?t:String(t)}var qy=(e,t,n)=>$v(e,t)?[]:Qy(Jy(e.content??[],t.content??[],0,n)),Jy=(e,t,n,r)=>{let i=0,a=Math.min(e.length,t.length);for(;i<a&&$v(e[i],t[i]);)i++;if(i===e.length&&i===t.length)return[];let o=0;for(;o<a-i&&$v(e[e.length-1-o],t[t.length-1-o]);)o++;let s=e.slice(i,e.length-o),c=t.slice(i,t.length-o),l=0;for(let t=0;t<i;t++)l+=sy(e[t],r);let u=n+l;if(s.length===0&&c.length===0)return[];if(s.length===0)return[{from:u,to:u,insert:c}];if(c.length===0){let e=0;for(let t of s)e+=sy(t,r);return[{from:u,to:u+e,insert:[]}]}return Yy(Zy(s,c,r),s,c,u,r)},Yy=(e,t,n,r,i)=>{let a=[],o=[],s=0;for(let e of t)o.push(s),s+=sy(e,i);let c=0;for(;c<e.length;){let s=e[c];if(s.type===`matched`){let e=t[s.oldIdx],l=n[s.newIdx];if($v(e,l)){c++;continue}let u=r+o[s.oldIdx],d=Xy(e,l,u,i);if(d)a.push(...d);else{let t=sy(e,i);a.push({from:u,to:u+t,insert:[l]})}c++;continue}let l=c,u=[],d=[];for(;c<e.length&&e[c].type!==`matched`;){let t=e[c];t.type===`deleted`?u.push(t.oldIdx):t.type===`inserted`&&d.push(n[t.newIdx]),c++}if(u.length===0&&d.length===0)continue;let f,p;if(u.length>0){let e=u[0],n=u[u.length-1];f=r+o[e],p=r+o[n]+sy(t[n],i)}else{let n=l>0?e[l-1]:void 0;f=n?.type===`matched`?r+o[n.oldIdx]+sy(t[n.oldIdx],i):r,p=f}a.push({from:f,to:p,insert:d})}return a.sort((e,t)=>t.from-e.from),a},Xy=(e,t,n,r)=>{if(e.type!==t.type||fy(e.type,r)||dy(e.type,r))return null;let i=e.content??[],a=t.content??[];if(!ey(e.attrs,t.attrs))return null;let o=Jy(i,a,n+1,r);return o.length===0?null:o},Zy=(e,t,n)=>{let r=e.length,i=t.length,a=Array.from({length:r+1},()=>Array(i+1).fill(0)),o=(e,t)=>a[e]?.[t]??0;for(let s=1;s<=r;s++){let r=a[s];for(let a=1;a<=i;a++)uy(e[s-1],t[a-1],n)?r[a]=o(s-1,a-1)+1:r[a]=Math.max(o(s-1,a),o(s,a-1))}let s=[],c=r,l=i;for(;c>0||l>0;)c>0&&l>0&&uy(e[c-1],t[l-1],n)&&o(c,l-1)<o(c,l)?(s.push({type:`matched`,oldIdx:c-1,newIdx:l-1}),c--,l--):l>0&&(c===0||o(c,l-1)>=o(c-1,l))?(s.push({type:`inserted`,newIdx:l-1}),l--):(s.push({type:`deleted`,oldIdx:c-1}),c--);return s.reverse(),s},Qy=e=>{if(e.length<=1)return e;e.sort((e,t)=>e.from-t.from);let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];r.to===i.from?t[t.length-1]={from:r.from,to:i.to,insert:[...r.insert,...i.insert]}:t.push(i)}return t.sort((e,t)=>t.from-e.from),t};function $y(e){return Object.assign(Object.assign({},e),{attrs:e.attrs?Object.assign({},e.attrs):void 0,marks:e.marks?.map(e=>Object.assign(Object.assign({},e),{attrs:e.attrs?Object.assign({},e.attrs):void 0})),content:e.content?.map(e=>$y(e))})}function eb(e){return Object.assign({type:e.type,attrs:e.attrs?Object.assign({},e.attrs):void 0,marks:e.marks?.map(e=>Object.assign(Object.assign({},e),{attrs:e.attrs?Object.assign({},e.attrs):void 0}))},e.text==null?{}:{text:e.text})}function tb(e,t){return ly(cy(e),cy(t))}function nb(e,t,n){if($v(e,t))return 1e4;if(!uy(e,t,n))return-1/0;let r=100;return ey(e.attrs,t.attrs)&&(r+=25),r+=tb(e,t),r}function rb(e,t,n,r){let i=null,a=-1/0;for(let o=n;o<t.length;o+=1){let s=t[o];if(!s)continue;let c=nb(e,s,r);if(!Number.isFinite(c))continue;let l=c-(o-n)*.1;if(l>a&&(a=l,i=o),c>=1e4)break}return i}function ib(e,t,n){return{node:$y(e),annotations:[Object.assign({path:[],type:t},n?{hunk:n}:{})]}}function ab(e,t,n){return{baseNode:e?$y(e):null,localNode:t?$y(t):null,remoteNode:n?$y(n):null}}function ob(e){return e.reduce((e,t)=>({appliedCount:e.appliedCount+ +(t.type===`applied`),conflictCount:e.conflictCount+ +(t.type===`conflict`)}),{appliedCount:0,conflictCount:0})}function sb(e,t){return e.map(e=>Object.assign({path:[t,...e.path],type:e.type},e.hunk?{hunk:e.hunk}:{}))}function cb(e,t,n){let r=t.content?.map(e=>$y(e))??[],i=n.content?.map(e=>$y(e))??[],a=cy(t),o=cy(n);if(a.length>0&&o.length>0){if(o.length>a.length&&o.includes(a))return{node:Object.assign(Object.assign({},eb(n)),{content:i}),annotations:[{path:[],type:`applied`}]};if(a.length>o.length&&a.includes(o))return{node:Object.assign(Object.assign({},eb(t)),{content:r}),annotations:[]}}let s=r.length>0&&i.length>0&&cy(t).length>0&&cy(n).length>0?[...r,{type:`text`,text:` `},...i]:[...r,...i];return{node:Object.assign(Object.assign({},eb(t)),{content:s}),annotations:[{path:[],type:`conflict`,hunk:ab(e,t,n)}]}}function lb(e,t,n,r){if(!t&&!n)return[];if(!t)return!n||$v(e,n)?[]:[ib(n,`conflict`,ab(e,null,n))];if(!n)return $v(e,t)?[]:[ib(t,`conflict`,ab(e,t,null))];let i=!$v(e,t),a=!$v(e,n);if(!i&&!a)return[{node:$y(t),annotations:[]}];if(!i&&a)return[ib(n,`applied`)];if(i&&!a||$v(t,n))return[{node:$y(t),annotations:[]}];if(t.type===n.type&&t.type===e.type&&ey(t.attrs,n.attrs)&&ey(e.attrs,t.attrs)){if(dy(t.type,r)&&!py(t.type,r))return[cb(e,t,n)];if(!fy(t.type,r)&&!py(t.type,r)&&t.content&&n.content&&e.content){let i=gb(e.content,t.content,n.content,r);return[{node:Object.assign(Object.assign({},eb(t)),{content:i.nodes}),annotations:i.annotations.map(e=>Object.assign({path:e.path,type:e.type},e.hunk?{hunk:e.hunk}:{}))}]}}return[{node:$y(t),annotations:[]},ib(n,`conflict`,ab(e,t,n))]}function ub(e,t,n){let r=[],i=0;for(let a of e){let e=rb(a,t,i,n);r.push(e),e!=null&&(i=e+1)}return r}function db(e,t){return Array.from({length:e},()=>Array(t).fill(0))}function fb(e,t,n){let r=n.get(e);if(r!==void 0)return r;let i;try{i=Lv(t.nodeFromJSON({type:`doc`,content:[e]}))}catch{i=JSON.stringify(e)}return n.set(e,i),i}function pb(e,t,n,r){return $v(e,t)?!0:fb(e,n,r)===fb(t,n,r)}function mb(e,t,n,r){let i=db(e.length+1,t.length+1);for(let a=e.length-1;a>=0;--a){let o=e[a],s=i[a],c=i[a+1];for(let e=t.length-1;e>=0;--e){let i=t[e],a=c[e],l=s[e+1];if(pb(o,i,n,r)){let t=c[e+1]+1;s[e]=t}else s[e]=Math.max(a,l)}}return i}function hb(e,t,n){return(e[t+1]?.[n]??0)>=(e[t]?.[n+1]??0)}function gb(e,t,n,r){let i=[],a=[],o=/* @__PURE__ */ new Map,s=ub(e,t,r),c=ub(e,n,r),l=e=>{let t=i.length;i.push(e.node),a.push(...sb(e.annotations,t))},u=(e,n)=>{for(let r=e;r<n;r+=1){let e=t[r];e&&l({node:$y(e),annotations:[]})}},d=(e,t,r)=>{for(let i=e;i<t;i+=1){let e=n[i];e&&l(ib(e,r))}},f=(e,i,a,s)=>{let c=t.slice(e,i),f=n.slice(a,s);if(c.length===0){d(a,s,`applied`);return}if(f.length===0){u(e,i);return}let p=mb(c,f,r,o),m=0,h=0;for(;m<c.length&&h<f.length;){let e=c[m],t=f[h];e&&t&&pb(e,t,r,o)?(l({node:$y(e),annotations:[]}),m+=1,h+=1):hb(p,m,h)?(l({node:$y(e),annotations:[]}),m+=1):(l(ib(t,`applied`)),h+=1)}u(e+m,i),d(a+h,s,`applied`)},p=0,m=0;for(let i=0;i<e.length;i+=1){let a=e[i],o=s[i]??null,u=c[i]??null;f(p,o??p,m,u??m);let d=o==null?void 0:t[o],h=u==null?void 0:n[u];for(let e of lb(a,d,h,r))l(e);o!=null&&(p=o+1),u!=null&&(m=u+1)}return f(p,t.length,m,n.length),{nodes:i,annotations:a}}function _b(e){let{baseDoc:t,localDoc:n,remoteDoc:r,schema:i}=e,a=gb(t.content??[],n.content??[],r.content??[],i),o=!ey(t.attrs,n.attrs),s=!ey(t.attrs,r.attrs),c=Object.assign(Object.assign({},eb(!o&&s?r:n)),{content:a.nodes}),l=[],u=a.annotations.map(e=>(e.type===`conflict`&&e.hunk&&l.push(Object.assign({path:e.path},e.hunk)),{path:e.path,type:e.type}));return{mergedDoc:c,annotations:u,conflicts:l,summary:ob(u)}}export{O as BLOCK_TYPES,Ot as CALLOUT_TYPES,Mt as COMMENT_THREAD_IDS_ATTR,zt as DEFAULT_CODE_BLOCK_LANGUAGE,En as DEFAULT_DATABASE_VIEW,Rt as DEFAULT_MERMAID_PLACEMENT,At as EDITOR_COMPONENT_NAMES,vg as FRONTMATTER_ATTRIBUTES_WITH_ARRAY_VALUES,_g as FRONTMATTER_ATTRIBUTES_WITH_BOOLEAN_VALUES,Ft as HIDDEN_NODE_ATTRS,kt as HTML_ELEMENTS,Lt as IMAGE_ALIGN_CLASSES,ey as attrsEqual,jv as canonicalPmToMdxOptions,Tn as createSchema,$v as deepEqual,qy as diffDocs,yh as extractDiffMarkers,qn as extractFrontmatter,cy as extractText,pg as filterFrontmatterRecord,Gn as findRedundantStaticHtmlSources,Tg as formatFrontmatterValue,xh as formatLineRanges,Sh as getDiffMarkerComment,rm as getImageAlignFromClassName,im as getImageWidthFromStyle,On as isDatabaseId,kn as isDatabaseView,Eg as isJSXContent,fg as isNonEmptyFrontmatterValue,dg as mdToPm,Ky as mdastToMdx,Ph as mdastToPm,Hp as mdxToMdast,Hh as mdxToPm,_b as mergeRemoteIntoLiveDoc,wn as mintlifySchema,sy as nodeSize,uy as nodesMatch,Vn as parseCommentThreadIds,Xp as parseExpressionAttribute,Kn as parseFrontmatterYaml,bh as parseLineRanges,$ as parseMdxAttributes,vh as parseMetaString,Gy as pmJsonToMdast,Lv as pmToMdx,Sy as pmToMdxPreservingSource,zn as readDatabaseSql,An as resolveDatabaseView,yg as safeJsonParse,Qp as sanitizeDomAttrs,Hn as serializeCommentThreadIds,In as serializeDatabaseSql,kg as serializePropValue,qv as startsWithPlaceholderParagraph,xg as storedValueToTyped,ly as textSimilarity};
|