grapper-editor
Version:
Grapper Source Code Editor
20 lines • 1.37 MB
JavaScript
var EU=Object.defineProperty;var uE=$e=>{throw TypeError($e)};var TU=($e,Qe,Le)=>Qe in $e?EU($e,Qe,{enumerable:!0,configurable:!0,writable:!0,value:Le}):$e[Qe]=Le;var oi=($e,Qe,Le)=>TU($e,typeof Qe!="symbol"?Qe+"":Qe,Le),Vg=($e,Qe,Le)=>Qe.has($e)||uE("Cannot "+Le);var z=($e,Qe,Le)=>(Vg($e,Qe,"read from private field"),Le?Le.call($e):Qe.get($e)),It=($e,Qe,Le)=>Qe.has($e)?uE("Cannot add the same private member more than once"):Qe instanceof WeakSet?Qe.add($e):Qe.set($e,Le),Et=($e,Qe,Le,Xi)=>(Vg($e,Qe,"write to private field"),Xi?Xi.call($e,Le):Qe.set($e,Le),Le),cE=($e,Qe,Le)=>(Vg($e,Qe,"access private method"),Le);var hE=($e,Qe,Le,Xi)=>({set _(Za){Et($e,Qe,Za,Le)},get _(){return z($e,Qe,Xi)}});(function(){"use strict";var Fl,kn,Pn,Ra,wh,yE,fr,Fn,Ks,ei,Ke,He,ti,ri,si,ii;const $e="function",Qe="undefined",Le="object",Xi="string",Za="array",Ml="number",Va="boolean",xE="date",Ll=(t,e)=>typeof t===e,DE=(t,e)=>t instanceof e,Zi=t=>Ll(t,Le),za=t=>Ll(t,Xi),ot=t=>Ll(t,$e),Yg=t=>!Number.isNaN(t),Ss=t=>Ll(t,Qe),bE=t=>Array.isArray(t),Wg=t=>DE(t,Date)&&!isNaN(t),Vi=t=>t===null,vE=t=>t.replace(/-([a-z0-9])/g,(e,r)=>r.toUpperCase());function SE(t){if(za(t))try{return JSON.parse(`{${t.replace(/^\s*{/,"").replace(/}\s*$/,"").split(/((?:[^;^,"']|"[^"]*"|'[^']*')+)/).filter(e=>!["",";",","].includes(e.trim())).map(e=>e.split(":")).map(e=>`"${e[0].trim()}":${Ua(e[1].trim(),void 0,!0)}`).join(",")}}`)}catch{try{return Ua(t)}catch(r){console.error(r);return}}if(Zi(t))return t}function Gg(t){if(za(t))return t.trim().startsWith("[")?(t.match(/\[(.*?)[^\]]]/g)||[]).map(e=>Gg(e.substring(1,e.length-1))):t.split(/[,;]/).map(e=>Ua(e.trim()));if(bE(t))return t}function Ua(t,e,r=!1){if(!za(t))return t;if(t=wE(t.trim()),e===Za)return Gg(t);if(e===Le)return SE(t);if(Ss(e)||e===Ml){if(Ss(t)||t==="")return;let s=+t;if(Yg(s)||e===Ml)return s}if(Ss(e)||e===Va){if(t==="true")return!0;if(t==="false")return!1;if(e===Va)return t==="0"?!1:!!t}if(e===xE){try{let s=new Date(t);if(Yg(s.getTime()))return s}catch{}return}if(Ss(e)||e===Xi)return r?`"${t}"`:t}function wE(t){return t[0]==="'"&&t[t.length-1]==="'"||t[0]==='"'&&t[t.length-1]==='"'?t.substring(1,t.length-1):t}const Hg=new WeakSet;let Ya=!1;const Wa=(t,e)=>!Zi(t)||Vi(t)||!ot(e)?t:function r(s){if(Hg.has(s))return s;for(let n in s)Zi(s[n])&&!Vi(s[n])&&(s[n]=r(s[n]));const i=new Proxy(s,{get(n,a){let l=Reflect.get(s,a);return ot(l)&&Wg(n)&&za(a)&&a.substring(0,3)==="set"&&ot(e)&&(l=function(...c){const p=Reflect.get(n,a).apply(n,c);return!Ya&&e(t),p}),Wg(n)?l.bind(n):l},set(n,a,l){let c;const p=n[a]===l;return Zi(l)&&!Vi(l)?c=Reflect.set(n,a,r(l)):c=Reflect.set(n,a,l),!Ya&&!p&&e(t),c},deleteProperty(n,a){let l=Reflect.deleteProperty(n,a);return!Ya&&e(t),l}});return Hg.add(i),i}(t);Wa.stop=()=>Ya=!0,Wa.start=()=>Ya=!1;const Ga=!1,_l=!0;function AE(t){return t===null?null:t.constructor?new t.constructor:{}}function Bh(t){if(!Zi(t))return t;const e=t===null?null:Object.assign(AE(t),t);for(let r in e)Zi(e[r])&&(e[r]=Bh(e[r]));return e}function CE(t,e){const r=[],s=[];function i(a,l){if(Vi(a)||Vi(l))return Ga;if(ot(a.valueOf)&&ot(l.valueOf)&&(a!==a.valueOf()||l!==l.valueOf()))return a.valueOf()===l.valueOf()&&a.constructor===l.constructor;if(r.indexOf(a)>-1&&s.indexOf(l)>-1)return _l;let c=Object.keys(a),p=Object.keys(l);if(c.length!==p.length)return Ga;if(c.length>0){r.push(a),s.push(l);let d=c.length;for(;d--;){const m=c[d];if(!n(a[m],l[m]))return Ga}}return _l}function n(a,l){if(a===l)return _l;const c=typeof a;return c!==typeof l?Ga:c===Ml&&isNaN(a)&&isNaN(l)?_l:c===Le?i(a,l):Ga}return n(t,e)}const lt=Symbol(),Rl=Symbol(),Wr=Symbol(),Ih=Object.defineProperty;function EE(t,e,r,s=!1){if(!(t.ready===!1||!e))if(s)r?t.setAttribute(e,""):t.removeAttribute(e);else{const i=Vi(r)||Ss(r)?"":r.toString();t.hasAttribute(e)&&t.getAttribute(e)!==i&&t.setAttribute(e,i)}}function TE(t){this[lt]={};let e=t;do{const r=ql.get(e);for(let s in r)if(r.hasOwnProperty(s)&&this.hasOwnProperty(s)){const i=this[s];delete this[s],this[s]=Ss(i)?Bh(r[s]):i}else s in this[lt]||(this[lt][s]=Bh(r[s]));e=Object.getPrototypeOf(e)}while(e!==HTMLElement)}function kE(){new MutationObserver(t=>{t.some(e=>!e.attributeName)&&this[Wr]("update"),(Ss(this.ready)||this.ready)&&ot(this[Rl])&&this[Rl](t)}).observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}const ql=new WeakMap;class Nh extends HTMLElement{constructor(){super(),TE.call(this,new.target),ot(this[Rl])&&kE.call(this)}[Wr](e,r={},s=!1){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r,composed:s}))}}function PE(t,e){e.propertyName||(e.propertyName=vE(e.name)),Jg(t,{...e,name:e.propertyName,attribute:e.name});const r=Object.getPrototypeOf(t),s="observedAttributes",i=Object.getOwnPropertyDescriptor(t,s),n=Object.getOwnPropertyDescriptor(r,s);let a=i?i.get:void 0;Ih(t,s,$E(t,e,r,a,i,n));const l="attributeChangedCallback",c=Object.getOwnPropertyDescriptor(t.prototype,l),p=Object.getOwnPropertyDescriptor(r.prototype,l);let d=c?c.value:void 0;Ih(t.prototype,l,FE(e,d,p))}function FE(t,e,r){return{value:function(s,i,n){if(t.name===s){const a=t.propertyName;this[a]!==n&&(t.type===Va?this[a]=this.hasAttribute(t.name):this[a]=Ua(n,t.type))}else e&&e.apply(this,arguments);r!=null&&r.value&&r.value.apply(this,arguments)},enumerable:!1,writable:!0,configurable:!0}}function $E(t,e,r,s,i,n){const a={enumerable:!1,configurable:!0};return i?n?a.get=function(){return[e.name,...s.call(t),...n.get.call(r)]}:a.get=function(){return[e.name,...s.call(t)]}:a.get=n?function(){return[e.name,...n.get.call(r)]}:function(){return[e.name]},a}function Jg(t,e){Ih(t.prototype,e.name,{set:Kg(e),get:BE(e),configurable:!0,enumerable:!1}),ql.has(t)||ql.set(t,{}),ql.get(t)[e.name]=e.value}function QE(t,e){Vi(t.posUpdateEvent)||(t.posUpdateEvent?this[Wr](t.posUpdateEvent,{[t.name]:e}):this[Wr]("update",{[t.name]:e})),ot(t.posUpdate)?t.posUpdate.call(this,e):ot(this[t.posUpdate])&&this[t.posUpdate]()}function Kg(t){return function(e){let r=this[lt];ot(t.preUpdate)&&!t.preUpdate.call(this,e)||(t.schema&&(Wa.stop(),e=t.schema.normalize(e),Wa.start()),!(!Zi(e)&&CE(r[t.name],e))&&(ot(t.set)?t.set.call(this,e):r[t.name]=za(e)&&t.type?Ua(e,t.type):e,t.attribute&&![Za,Le].includes(t.type)&&EE(this,t.attribute,e,t.type===Va),QE.call(this,t,e)))}}function BE(t){return function(){if(ot(t.get))return t.get.call(this);{const e=this[lt];switch(t.type){case Ml:return Ss(e[t.name])?void 0:Number(e[t.name]);case Va:return!!e[t.name];case Le:case Za:return Wa(e[t.name]||(t.type===Le?{}:[]),r=>Kg(t).call(this,r));default:return e[t.name]}}}}function IE(t,e){e=e.toLowerCase(),customElements.get(e)||customElements.define(e,t)}function NE(t,e={}){return e.prop=(...r)=>(r.forEach(s=>Jg(t,{...s})),e),e.attr=(...r)=>(r.forEach(s=>PE(t,{...s})),e),e.tag=r=>(IE(t,r),e),e.extension=e.ext=r=>(r.call(e,e,t),e),e}Nh.CHANGE=Rl,Nh.FIRE_EVENT=Wr;function ey(t,e){const r=new WeakMap,s=[];return function(...i){return clearTimeout(r.get(this)),new Promise((n,a)=>{s.push({resolve:n,reject:a}),r.set(this,setTimeout(()=>{try{const l=t.apply(this,i);s.forEach(c=>c.resolve(l))}catch(l){s.forEach(c=>c.reject(l))}finally{s.length=0}},e))})}}function ty(t,e){return function(...r){if(t.apply(this,r))return e.apply(this,r)}}function ry(t,e){return function(...r){const s=t.apply(this,r);return ot(s.then)?s.then(i=>e.call(this,i)||i):e.call(this,s)||s}}const sy=1,Mh=Symbol(),Lh=Symbol(),Qn=Symbol(),Qr=Symbol(),iy=Symbol(),_h=Symbol(),ny=(t,e)=>{var r;return(r=t[e])==null?void 0:r.forEach(s=>ot(s)&&s.apply(t))};class li extends Nh{constructor(e){super(),this.attachShadow({mode:"open"}),this[lt].ready=e||!1,this[lt].rendered=!1,Ss(e)&&(this.ready=!0)}get ready(){return this[lt].ready}set ready(e){const r=this[lt],s=r.ready;r.ready=!!e,s===!1&&r.ready===!0&&(this[Wr]("ready",{ready:!0}),ot(this[Qr])&&this[Qr]())}get rendered(){return this[lt].rendered}set rendered(e){const r=this[lt],s=r.rendered;r.rendered=!!e,s===!1&&r.rendered===!0&&this[Wr]("render",{rendered:!0})}connectedCallback(){let e=this.getBoundingClientRect(),r=getComputedStyle(this).flexDirection;const s=()=>{let{width:i,height:n}=this.getBoundingClientRect(),a=getComputedStyle(this).flexDirection;(i!==e.width||n!==e.height||a!==r)&&(ot(this[iy])&&this[iy](i,n,i-e.width,n-e.height),e={width:i,height:n},r=a,this[Wr]("resize",e)),this[lt]._resizeObserver=window.requestAnimationFrame(s)};s(),ny(this,Mh)}disconnectedCallback(){window.cancelAnimationFrame(this[lt]._resizeObserver),ny(this,Lh)}}li.prototype[Mh]=[],li.prototype[Lh]=[];function ME(t,e){var s,i,n,a;const r={name:e.name.startsWith("--")?e.name:`--${e.name}`,initialValue:(i=(s=e.initialValue)!=null?s:e.value)!=null?i:"",syntax:(n=e.syntax)!=null?n:"*",inherits:(a=e.inherits)!=null?a:!0};t.prototype[_h]||(t.prototype[_h]={}),t.prototype[_h][r.name]=r}function LE(t){if(ot(t.prototype[Qr])){const e=t.prototype[Qr];t.prototype[Qr]=ty(function(){return this.rendered=!1,this.ready},ey(ry(async function(){return e.apply(this)},function(r){this.rendered=r!==!1,this.rendered&&ot(this[Qn])&&this[Qn]()}),sy))}if(ot(t.prototype[Qn])){const e=t.prototype[Qn];t.prototype[Qn]=ty(function(r){return r&&(this[lt].rendered=!0),this.ready&&this[lt].rendered},ey(ry(async function(...r){return e.apply(this,r)},function(){this[Wr]("refresh")}),sy))}}function ay(t){LE(t);const e=NE(t,{style:(...r)=>(r.forEach(s=>ME(t,{...s})),e)});return e}li.RENDER=Qr,li.REFRESH=Qn,li.ONCONNECT=Mh,li.ONDISCONNECT=Lh;var _E=Object.create,Rh=Object.defineProperty,RE=Object.getOwnPropertyDescriptor,qE=Object.getOwnPropertyNames,jE=Object.getPrototypeOf,XE=Object.prototype.hasOwnProperty,oy=t=>{throw TypeError(t)},ZE=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qh=(t,e)=>{for(var r in e)Rh(t,r,{get:e[r],enumerable:!0})},VE=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qE(e))!XE.call(t,i)&&i!==r&&Rh(t,i,{get:()=>e[i],enumerable:!(s=RE(e,i))||s.enumerable});return t},zE=(t,e,r)=>(r=t!=null?_E(jE(t)):{},VE(Rh(r,"default",{value:t,enumerable:!0}),t)),UE=(t,e,r)=>e.has(t)||oy("Cannot "+r),YE=(t,e,r)=>e.has(t)?oy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Ha=(t,e,r)=>(UE(t,e,"access private method"),r),WE=ZE(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(){return new Proxy({},{get:()=>n=>n})}var r=/\r\n|[\n\r\u2028\u2029]/;function s(n,a,l){let c=Object.assign({column:0,line:-1},n.start),p=Object.assign({},c,n.end),{linesAbove:d=2,linesBelow:m=3}=l||{},y=c.line,g=c.column,x=p.line,v=p.column,w=Math.max(y-(d+1),0),C=Math.min(a.length,x+m);y===-1&&(w=0),x===-1&&(C=a.length);let b=x-y,k={};if(b)for(let Q=0;Q<=b;Q++){let F=Q+y;if(!g)k[F]=!0;else if(Q===0){let $=a[F-1].length;k[F]=[g,$-g+1]}else if(Q===b)k[F]=[0,v];else{let $=a[F-Q].length;k[F]=[0,$]}}else g===v?g?k[y]=[g,0]:k[y]=!0:k[y]=[g,v-g];return{start:w,end:C,markerLines:k}}function i(n,a,l={}){let c=e(),p=n.split(r),{start:d,end:m,markerLines:y}=s(a,p,l),g=a.start&&typeof a.start.column=="number",x=String(m).length,v=n.split(r,m).slice(d,m).map((w,C)=>{let b=d+1+C,k=` ${` ${b}`.slice(-x)} |`,Q=y[b],F=!y[b+1];if(Q){let $="";if(Array.isArray(Q)){let N=w.slice(0,Math.max(Q[0]-1,0)).replace(/[^\t]/g," "),_=Q[1]||1;$=[`
`,c.gutter(k.replace(/\d/g," "))," ",N,c.marker("^").repeat(_)].join(""),F&&l.message&&($+=" "+c.message(l.message))}return[c.marker(">"),c.gutter(k),w.length>0?` ${w}`:"",$].join("")}else return` ${c.gutter(k)}${w.length>0?` ${w}`:""}`}).join(`
`);return l.message&&!g&&(v=`${" ".repeat(x+1)}${l.message}
${v}`),v}t.codeFrameColumns=i}),GE={};qh(GE,{__debug:()=>uF,check:()=>oF,doc:()=>xO,format:()=>so,formatWithCursor:()=>vO,getSupportInfo:()=>lF,util:()=>DO,version:()=>IP});var HE=(t,e,r,s)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,s):r.global?e.replace(r,s):e.split(r).join(s)},jl=HE,JE=class{diff(e,r,s={}){let i;typeof s=="function"?(i=s,s={}):"callback"in s&&(i=s.callback);let n=this.castInput(e,s),a=this.castInput(r,s),l=this.removeEmpty(this.tokenize(n,s)),c=this.removeEmpty(this.tokenize(a,s));return this.diffWithOptionsObj(l,c,s,i)}diffWithOptionsObj(e,r,s,i){var n;let a=b=>{if(b=this.postProcess(b,s),i){setTimeout(function(){i(b)},0);return}else return b},l=r.length,c=e.length,p=1,d=l+c;s.maxEditLength!=null&&(d=Math.min(d,s.maxEditLength));let m=(n=s.timeout)!==null&&n!==void 0?n:1/0,y=Date.now()+m,g=[{oldPos:-1,lastComponent:void 0}],x=this.extractCommon(g[0],r,e,0,s);if(g[0].oldPos+1>=c&&x+1>=l)return a(this.buildValues(g[0].lastComponent,r,e));let v=-1/0,w=1/0,C=()=>{for(let b=Math.max(v,-p);b<=Math.min(w,p);b+=2){let k,Q=g[b-1],F=g[b+1];Q&&(g[b-1]=void 0);let $=!1;if(F){let _=F.oldPos-b;$=F&&0<=_&&_<l}let N=Q&&Q.oldPos+1<c;if(!$&&!N){g[b]=void 0;continue}if(!N||$&&Q.oldPos<F.oldPos?k=this.addToPath(F,!0,!1,0,s):k=this.addToPath(Q,!1,!0,1,s),x=this.extractCommon(k,r,e,b,s),k.oldPos+1>=c&&x+1>=l)return a(this.buildValues(k.lastComponent,r,e))||!0;g[b]=k,k.oldPos+1>=c&&(w=Math.min(w,b-1)),x+1>=l&&(v=Math.max(v,b+1))}p++};if(i)(function b(){setTimeout(function(){if(p>d||Date.now()>y)return i(void 0);C()||b()},0)})();else for(;p<=d&&Date.now()<=y;){let b=C();if(b)return b}}addToPath(e,r,s,i,n){let a=e.lastComponent;return a&&!n.oneChangePerToken&&a.added===r&&a.removed===s?{oldPos:e.oldPos+i,lastComponent:{count:a.count+1,added:r,removed:s,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:s,previousComponent:a}}}extractCommon(e,r,s,i,n){let a=r.length,l=s.length,c=e.oldPos,p=c-i,d=0;for(;p+1<a&&c+1<l&&this.equals(s[c+1],r[p+1],n);)p++,c++,d++,n.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!n.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,p}equals(e,r,s){return s.comparator?s.comparator(e,r):e===r||!!s.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let s=0;s<e.length;s++)e[s]&&r.push(e[s]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,s){let i=[],n;for(;e;)i.push(e),n=e.previousComponent,delete e.previousComponent,e=n;i.reverse();let a=i.length,l=0,c=0,p=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(s.slice(p,p+d.count)),p+=d.count;else{if(!d.added&&this.useLongestToken){let m=r.slice(c,c+d.count);m=m.map(function(y,g){let x=s[p+g];return x.length>y.length?x:y}),d.value=this.join(m)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(p+=d.count)}}return i}},KE=class extends JE{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},eT=new KE;function tT(t,e,r){return eT.diff(t,e,r)}function rT(t){let e=t.indexOf("\r");return e!==-1?t.charAt(e+1)===`
`?"crlf":"cr":"lf"}function jh(t){switch(t){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function ly(t,e){let r;switch(e){case`
`:r=/\n/gu;break;case"\r":r=/\r/gu;break;case`\r
`:r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(e)}.`)}let s=t.match(r);return s?s.length:0}function sT(t){return jl(!1,t,/\r\n?/gu,`
`)}var zi="string",ws="array",ui="cursor",As="indent",Cs="align",Es="trim",Xt="group",Gr="fill",rr="if-break",Ts="indent-if-break",ks="line-suffix",Ps="line-suffix-boundary",yt="line",Hr="label",xr="break-parent",uy=new Set([ui,As,Cs,Es,Xt,Gr,rr,Ts,ks,Ps,yt,Hr,xr]),iT=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},dt=iT;function nT(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===`
`);)e--;return e<t.length?t.slice(0,e):t}function aT(t){if(typeof t=="string")return zi;if(Array.isArray(t))return ws;if(!t)return;let{type:e}=t;if(uy.has(e))return e}var Ui=aT,oT=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function lT(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(Ui(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let s=oT([...uy].map(i=>`'${i}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${s}.`}var uT=class extends Error{constructor(r){super(lT(r));oi(this,"name","InvalidDocError");this.doc=r}},Bn=uT,cy={};function cT(t,e,r,s){let i=[t];for(;i.length>0;){let n=i.pop();if(n===cy){r(i.pop());continue}r&&i.push(n,cy);let a=Ui(n);if(!a)throw new Bn(n);if((e==null?void 0:e(n))!==!1)switch(a){case ws:case Gr:{let l=a===ws?n:n.parts;for(let c=l.length,p=c-1;p>=0;--p)i.push(l[p]);break}case rr:i.push(n.flatContents,n.breakContents);break;case Xt:if(s&&n.expandedStates)for(let l=n.expandedStates.length,c=l-1;c>=0;--c)i.push(n.expandedStates[c]);else i.push(n.contents);break;case Cs:case As:case Ts:case Hr:case ks:i.push(n.contents);break;case zi:case ui:case Es:case Ps:case yt:case xr:break;default:throw new Bn(n)}}}var Xh=cT;function Xl(t,e){if(typeof t=="string")return e(t);let r=new Map;return s(t);function s(n){if(r.has(n))return r.get(n);let a=i(n);return r.set(n,a),a}function i(n){switch(Ui(n)){case ws:return e(n.map(s));case Gr:return e({...n,parts:n.parts.map(s)});case rr:return e({...n,breakContents:s(n.breakContents),flatContents:s(n.flatContents)});case Xt:{let{expandedStates:a,contents:l}=n;return a?(a=a.map(s),l=a[0]):l=s(l),e({...n,contents:l,expandedStates:a})}case Cs:case As:case Ts:case Hr:case ks:return e({...n,contents:s(n.contents)});case zi:case ui:case Es:case Ps:case yt:case xr:return e(n);default:throw new Bn(n)}}}function Zh(t,e,r){let s=r,i=!1;function n(a){if(i)return!1;let l=e(a);l!==void 0&&(i=!0,s=l)}return Xh(t,n),s}function hT(t){if(t.type===Xt&&t.break||t.type===yt&&t.hard||t.type===xr)return!0}function pT(t){return Zh(t,hT,!1)}function hy(t){if(t.length>0){let e=dt(!1,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function dT(t){let e=new Set,r=[];function s(n){if(n.type===xr&&hy(r),n.type===Xt){if(r.push(n),e.has(n))return!1;e.add(n)}}function i(n){n.type===Xt&&r.pop().break&&hy(r)}Xh(t,s,i,!0)}function fT(t){return t.type===yt&&!t.hard?t.soft?"":" ":t.type===rr?t.flatContents:t}function mT(t){return Xl(t,fT)}function py(t){for(t=[...t];t.length>=2&&dt(!1,t,-2).type===yt&&dt(!1,t,-1).type===xr;)t.length-=2;if(t.length>0){let e=Ja(dt(!1,t,-1));t[t.length-1]=e}return t}function Ja(t){switch(Ui(t)){case As:case Ts:case Xt:case ks:case Hr:{let e=Ja(t.contents);return{...t,contents:e}}case rr:return{...t,breakContents:Ja(t.breakContents),flatContents:Ja(t.flatContents)};case Gr:return{...t,parts:py(t.parts)};case ws:return py(t);case zi:return nT(t);case Cs:case ui:case Es:case Ps:case yt:case xr:break;default:throw new Bn(t)}return t}function dy(t){return Ja(yT(t))}function gT(t){switch(Ui(t)){case Gr:if(t.parts.every(e=>e===""))return"";break;case Xt:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===Xt&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case Cs:case As:case Ts:case ks:if(!t.contents)return"";break;case rr:if(!t.flatContents&&!t.breakContents)return"";break;case ws:{let e=[];for(let r of t){if(!r)continue;let[s,...i]=Array.isArray(r)?r:[r];typeof s=="string"&&typeof dt(!1,e,-1)=="string"?e[e.length-1]+=s:e.push(s),e.push(...i)}return e.length===0?"":e.length===1?e[0]:e}case zi:case ui:case Es:case Ps:case yt:case Hr:case xr:break;default:throw new Bn(t)}return t}function yT(t){return Xl(t,e=>gT(e))}function OT(t,e=yy){return Xl(t,r=>typeof r=="string"?Oy(e,r.split(`
`)):r)}function xT(t){if(t.type===yt)return!0}function DT(t){return Zh(t,xT,!1)}function Zl(t,e){return t.type===Hr?{...t,contents:e(t.contents)}:e(t)}var bT=()=>{},vT=bT;function Vl(t){return{type:As,contents:t}}function In(t,e){return{type:Cs,contents:e,n:t}}function fy(t,e={}){return vT(e.expandedStates),{type:Xt,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function ST(t){return In(Number.NEGATIVE_INFINITY,t)}function wT(t){return In({type:"root"},t)}function AT(t){return In(-1,t)}function CT(t,e){return fy(t[0],{...e,expandedStates:t})}function ET(t){return{type:Gr,parts:t}}function TT(t,e="",r={}){return{type:rr,breakContents:t,flatContents:e,groupId:r.groupId}}function kT(t,e){return{type:Ts,contents:t,groupId:e.groupId,negate:e.negate}}function Vh(t){return{type:ks,contents:t}}var PT={type:Ps},zl={type:xr},FT={type:Es},zh={type:yt,hard:!0},my={type:yt,hard:!0,literal:!0},gy={type:yt},$T={type:yt,soft:!0},Yi=[zh,zl],yy=[my,zl],Wi={type:ui};function Oy(t,e){let r=[];for(let s=0;s<e.length;s++)s!==0&&r.push(t),r.push(e[s]);return r}function xy(t,e,r){let s=t;if(e>0){for(let i=0;i<Math.floor(e/r);++i)s=Vl(s);s=In(e%r,s),s=In(Number.NEGATIVE_INFINITY,s)}return s}function QT(t,e){return t?{type:Hr,label:t,contents:e}:e}function Fs(t){var e;if(!t)return"";if(Array.isArray(t)){let r=[];for(let s of t)if(Array.isArray(s))r.push(...Fs(s));else{let i=Fs(s);i!==""&&r.push(i)}return r}return t.type===rr?{...t,breakContents:Fs(t.breakContents),flatContents:Fs(t.flatContents)}:t.type===Xt?{...t,contents:Fs(t.contents),expandedStates:(e=t.expandedStates)==null?void 0:e.map(Fs)}:t.type===Gr?{type:"fill",parts:t.parts.map(Fs)}:t.contents?{...t,contents:Fs(t.contents)}:t}function BT(t){let e=Object.create(null),r=new Set;return s(Fs(t));function s(n,a,l){var c,p;if(typeof n=="string")return JSON.stringify(n);if(Array.isArray(n)){let d=n.map(s).filter(Boolean);return d.length===1?d[0]:`[${d.join(", ")}]`}if(n.type===yt){let d=((c=l==null?void 0:l[a+1])==null?void 0:c.type)===xr;return n.literal?d?"literalline":"literallineWithoutBreakParent":n.hard?d?"hardline":"hardlineWithoutBreakParent":n.soft?"softline":"line"}if(n.type===xr)return((p=l==null?void 0:l[a-1])==null?void 0:p.type)===yt&&l[a-1].hard?void 0:"breakParent";if(n.type===Es)return"trim";if(n.type===As)return"indent("+s(n.contents)+")";if(n.type===Cs)return n.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+s(n.contents)+")":n.n<0?"dedent("+s(n.contents)+")":n.n.type==="root"?"markAsRoot("+s(n.contents)+")":"align("+JSON.stringify(n.n)+", "+s(n.contents)+")";if(n.type===rr)return"ifBreak("+s(n.breakContents)+(n.flatContents?", "+s(n.flatContents):"")+(n.groupId?(n.flatContents?"":', ""')+`, { groupId: ${i(n.groupId)} }`:"")+")";if(n.type===Ts){let d=[];n.negate&&d.push("negate: true"),n.groupId&&d.push(`groupId: ${i(n.groupId)}`);let m=d.length>0?`, { ${d.join(", ")} }`:"";return`indentIfBreak(${s(n.contents)}${m})`}if(n.type===Xt){let d=[];n.break&&n.break!=="propagated"&&d.push("shouldBreak: true"),n.id&&d.push(`id: ${i(n.id)}`);let m=d.length>0?`, { ${d.join(", ")} }`:"";return n.expandedStates?`conditionalGroup([${n.expandedStates.map(y=>s(y)).join(",")}]${m})`:`group(${s(n.contents)}${m})`}if(n.type===Gr)return`fill([${n.parts.map(d=>s(d)).join(", ")}])`;if(n.type===ks)return"lineSuffix("+s(n.contents)+")";if(n.type===Ps)return"lineSuffixBoundary";if(n.type===Hr)return`label(${JSON.stringify(n.label)}, ${s(n.contents)})`;if(n.type===ui)return"cursor";throw new Error("Unknown doc type "+n.type)}function i(n){if(typeof n!="symbol")return JSON.stringify(String(n));if(n in e)return e[n];let a=n.description||"symbol";for(let l=0;;l++){let c=a+(l>0?` #${l}`:"");if(!r.has(c))return r.add(c),e[n]=`Symbol.for(${JSON.stringify(c)})`}}}var IT=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function NT(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function MT(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}var LT=t=>!(NT(t)||MT(t)),_T=/[^\x20-\x7F]/u;function RT(t){if(!t)return 0;if(!_T.test(t))return t.length;t=t.replace(IT()," ");let e=0;for(let r of t){let s=r.codePointAt(0);s<=31||s>=127&&s<=159||s>=768&&s<=879||(e+=LT(s)?1:2)}return e}var Uh=RT,Zt=Symbol("MODE_BREAK"),Jr=Symbol("MODE_FLAT"),Nn=Symbol("cursor"),Yh=Symbol("DOC_FILL_PRINTED_LENGTH");function Dy(){return{value:"",length:0,queue:[]}}function qT(t,e){return Wh(t,{type:"indent"},e)}function jT(t,e,r){return e===Number.NEGATIVE_INFINITY?t.root||Dy():e<0?Wh(t,{type:"dedent"},r):e?e.type==="root"?{...t,root:t}:Wh(t,{type:typeof e=="string"?"stringAlign":"numberAlign",n:e},r):t}function Wh(t,e,r){let s=e.type==="dedent"?t.queue.slice(0,-1):[...t.queue,e],i="",n=0,a=0,l=0;for(let x of s)switch(x.type){case"indent":d(),r.useTabs?c(1):p(r.tabWidth);break;case"stringAlign":d(),i+=x.n,n+=x.n.length;break;case"numberAlign":a+=1,l+=x.n;break;default:throw new Error(`Unexpected type '${x.type}'`)}return y(),{...t,value:i,length:n,queue:s};function c(x){i+=" ".repeat(x),n+=r.tabWidth*x}function p(x){i+=" ".repeat(x),n+=x}function d(){r.useTabs?m():y()}function m(){a>0&&c(a),g()}function y(){l>0&&p(l),g()}function g(){a=0,l=0}}function Gh(t){let e=0,r=0,s=t.length;e:for(;s--;){let i=t[s];if(i===Nn){r++;continue}for(let n=i.length-1;n>=0;n--){let a=i[n];if(a===" "||a===" ")e++;else{t[s]=i.slice(0,n+1);break e}}}if(e>0||r>0)for(t.length=s+1;r-- >0;)t.push(Nn);return e}function Ul(t,e,r,s,i,n){var p;if(r===Number.POSITIVE_INFINITY)return!0;let a=e.length,l=[t],c=[];for(;r>=0;){if(l.length===0){if(a===0)return!0;l.push(e[--a]);continue}let{mode:d,doc:m}=l.pop(),y=Ui(m);switch(y){case zi:c.push(m),r-=Uh(m);break;case ws:case Gr:{let g=y===ws?m:m.parts,x=(p=m[Yh])!=null?p:0;for(let v=g.length-1;v>=x;v--)l.push({mode:d,doc:g[v]});break}case As:case Cs:case Ts:case Hr:l.push({mode:d,doc:m.contents});break;case Es:r+=Gh(c);break;case Xt:{if(n&&m.break)return!1;let g=m.break?Zt:d,x=m.expandedStates&&g===Zt?dt(!1,m.expandedStates,-1):m.contents;l.push({mode:g,doc:x});break}case rr:{let g=(m.groupId?i[m.groupId]||Jr:d)===Zt?m.breakContents:m.flatContents;g&&l.push({mode:d,doc:g});break}case yt:if(d===Zt||m.hard)return!0;m.soft||(c.push(" "),r--);break;case ks:s=!0;break;case Ps:if(s)return!1;break}}return!1}function Yl(t,e){var y;let r={},s=e.printWidth,i=jh(e.endOfLine),n=0,a=[{ind:Dy(),mode:Zt,doc:t}],l=[],c=!1,p=[],d=0;for(dT(t);a.length>0;){let{ind:g,mode:x,doc:v}=a.pop();switch(Ui(v)){case zi:{let w=i!==`
`?jl(!1,v,`
`,i):v;l.push(w),a.length>0&&(n+=Uh(w));break}case ws:for(let w=v.length-1;w>=0;w--)a.push({ind:g,mode:x,doc:v[w]});break;case ui:if(d>=2)throw new Error("There are too many 'cursor' in doc.");l.push(Nn),d++;break;case As:a.push({ind:qT(g,e),mode:x,doc:v.contents});break;case Cs:a.push({ind:jT(g,v.n,e),mode:x,doc:v.contents});break;case Es:n-=Gh(l);break;case Xt:switch(x){case Jr:if(!c){a.push({ind:g,mode:v.break?Zt:Jr,doc:v.contents});break}case Zt:{c=!1;let w={ind:g,mode:Jr,doc:v.contents},C=s-n,b=p.length>0;if(!v.break&&Ul(w,a,C,b,r))a.push(w);else if(v.expandedStates){let k=dt(!1,v.expandedStates,-1);if(v.break){a.push({ind:g,mode:Zt,doc:k});break}else for(let Q=1;Q<v.expandedStates.length+1;Q++)if(Q>=v.expandedStates.length){a.push({ind:g,mode:Zt,doc:k});break}else{let F=v.expandedStates[Q],$={ind:g,mode:Jr,doc:F};if(Ul($,a,C,b,r)){a.push($);break}}}else a.push({ind:g,mode:Zt,doc:v.contents});break}}v.id&&(r[v.id]=dt(!1,a,-1).mode);break;case Gr:{let w=s-n,C=(y=v[Yh])!=null?y:0,{parts:b}=v,k=b.length-C;if(k===0)break;let Q=b[C+0],F=b[C+1],$={ind:g,mode:Jr,doc:Q},N={ind:g,mode:Zt,doc:Q},_=Ul($,[],w,p.length>0,r,!0);if(k===1){_?a.push($):a.push(N);break}let W={ind:g,mode:Jr,doc:F},V={ind:g,mode:Zt,doc:F};if(k===2){_?a.push(W,$):a.push(V,N);break}let j=b[C+2],I={ind:g,mode:x,doc:{...v,[Yh]:C+2}};Ul({ind:g,mode:Jr,doc:[Q,F,j]},[],w,p.length>0,r,!0)?a.push(I,W,$):_?a.push(I,V,$):a.push(I,V,N);break}case rr:case Ts:{let w=v.groupId?r[v.groupId]:x;if(w===Zt){let C=v.type===rr?v.breakContents:v.negate?v.contents:Vl(v.contents);C&&a.push({ind:g,mode:x,doc:C})}if(w===Jr){let C=v.type===rr?v.flatContents:v.negate?Vl(v.contents):v.contents;C&&a.push({ind:g,mode:x,doc:C})}break}case ks:p.push({ind:g,mode:x,doc:v.contents});break;case Ps:p.length>0&&a.push({ind:g,mode:x,doc:zh});break;case yt:switch(x){case Jr:if(v.hard)c=!0;else{v.soft||(l.push(" "),n+=1);break}case Zt:if(p.length>0){a.push({ind:g,mode:x,doc:v},...p.reverse()),p.length=0;break}v.literal?g.root?(l.push(i,g.root.value),n=g.root.length):(l.push(i),n=0):(n-=Gh(l),l.push(i+g.value),n=g.length);break}break;case Hr:a.push({ind:g,mode:x,doc:v.contents});break;case xr:break;default:throw new Bn(v)}a.length===0&&p.length>0&&(a.push(...p.reverse()),p.length=0)}let m=l.indexOf(Nn);if(m!==-1){let g=l.indexOf(Nn,m+1);if(g===-1)return{formatted:l.filter(C=>C!==Nn).join("")};let x=l.slice(0,m).join(""),v=l.slice(m+1,g).join(""),w=l.slice(g+1).join("");return{formatted:x+v+w,cursorNodeStart:x.length,cursorNodeText:v}}return{formatted:l.join("")}}function XT(t,e,r=0){let s=0;for(let i=r;i<t.length;++i)t[i]===" "?s=s+e-s%e:s++;return s}var Hh=XT,Gi,Jh,Wl,ZT=class{constructor(e){YE(this,Gi),this.stack=[e]}get key(){var s;let{stack:e,siblings:r}=this;return(s=dt(!1,e,r===null?-2:-4))!=null?s:null}get index(){return this.siblings===null?null:dt(!1,this.stack,-2)}get node(){return dt(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,r=dt(!1,e,-3);return Array.isArray(r)?r:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:r}=this;return e!==null&&r===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...Ha(this,Gi,Wl).call(this)]}getName(){let{stack:e}=this,{length:r}=e;return r>1?dt(!1,e,-2):null}getValue(){return dt(!1,this.stack,-1)}getNode(e=0){let r=Ha(this,Gi,Jh).call(this,e);return r===-1?null:this.stack[r]}getParentNode(e=0){return this.getNode(e+1)}call(e,...r){let{stack:s}=this,{length:i}=s,n=dt(!1,s,-1);for(let a of r)n=n[a],s.push(a,n);try{return e(this)}finally{s.length=i}}callParent(e,r=0){let s=Ha(this,Gi,Jh).call(this,r+1),i=this.stack.splice(s+1);try{return e(this)}finally{this.stack.push(...i)}}each(e,...r){let{stack:s}=this,{length:i}=s,n=dt(!1,s,-1);for(let a of r)n=n[a],s.push(a,n);try{for(let a=0;a<n.length;++a)s.push(a,n[a]),e(this,a,n),s.length-=2}finally{s.length=i}}map(e,...r){let s=[];return this.each((i,n,a)=>{s[n]=e(i,n,a)},...r),s}match(...e){let r=this.stack.length-1,s=null,i=this.stack[r--];for(let n of e){if(i===void 0)return!1;let a=null;if(typeof s=="number"&&(a=s,s=this.stack[r--],i=this.stack[r--]),n&&!n(i,s,a))return!1;s=this.stack[r--],i=this.stack[r--]}return!0}findAncestor(e){for(let r of Ha(this,Gi,Wl).call(this))if(e(r))return r}hasAncestor(e){for(let r of Ha(this,Gi,Wl).call(this))if(e(r))return!0;return!1}};Gi=new WeakSet,Jh=function(t){let{stack:e}=this;for(let r=e.length-1;r>=0;r-=2)if(!Array.isArray(e[r])&&--t<0)return r;return-1},Wl=function*(){let{stack:t}=this;for(let e=t.length-3;e>=0;e-=2){let r=t[e];Array.isArray(r)||(yield r)}};var VT=ZT,by=new Proxy(()=>{},{get:()=>by}),Kh=by;function zT(t){return t!==null&&typeof t=="object"}var UT=zT;function*Gl(t,e){let{getVisitorKeys:r,filter:s=()=>!0}=e,i=n=>UT(n)&&s(n);for(let n of r(t)){let a=t[n];if(Array.isArray(a))for(let l of a)i(l)&&(yield l);else i(a)&&(yield a)}}function*YT(t,e){let r=[t];for(let s=0;s<r.length;s++){let i=r[s];for(let n of Gl(i,e))yield n,r.push(n)}}function WT(t,e){return Gl(t,e).next().done}function Ka(t){return(e,r,s)=>{let i=!!(s!=null&&s.backwards);if(r===!1)return!1;let{length:n}=e,a=r;for(;a>=0&&a<n;){let l=e.charAt(a);if(t instanceof RegExp){if(!t.test(l))return a}else if(!t.includes(l))return a;i?a--:a++}return a===-1||a===n?a:!1}}var GT=Ka(/\s/u),ci=Ka(" "),vy=Ka(",; "),Sy=Ka(/[^\n\r]/u);function HT(t,e,r){let s=!!(r!=null&&r.backwards);if(e===!1)return!1;let i=t.charAt(e);if(s){if(t.charAt(e-1)==="\r"&&i===`
`)return e-2;if(i===`
`||i==="\r"||i==="\u2028"||i==="\u2029")return e-1}else{if(i==="\r"&&t.charAt(e+1)===`
`)return e+2;if(i===`
`||i==="\r"||i==="\u2028"||i==="\u2029")return e+1}return e}var Hi=HT;function JT(t,e,r={}){let s=ci(t,r.backwards?e-1:e,r),i=Hi(t,s,r);return s!==i}var hi=JT;function KT(t){return Array.isArray(t)&&t.length>0}var ek=KT,wy=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),tk=t=>Object.keys(t).filter(e=>!wy.has(e));function rk(t){return t?e=>t(e,wy):tk}var Hl=rk;function sk(t){let e=t.type||t.kind||"(unknown type)",r=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return r.length>20&&(r=r.slice(0,19)+"…"),e+(r?" "+r:"")}function ep(t,e){var r;((r=t.comments)!=null?r:t.comments=[]).push(e),e.printed=!1,e.nodeDescription=sk(t)}function eo(t,e){e.leading=!0,e.trailing=!1,ep(t,e)}function Ji(t,e,r){e.leading=!1,e.trailing=!1,r&&(e.marker=r),ep(t,e)}function to(t,e){e.leading=!1,e.trailing=!0,ep(t,e)}var tp=new WeakMap;function rp(t,e){var c;if(tp.has(t))return tp.get(t);let{printer:{getCommentChildNodes:r,canAttachComment:s,getVisitorKeys:i},locStart:n,locEnd:a}=e;if(!s)return[];let l=((c=r==null?void 0:r(t,e))!=null?c:[...Gl(t,{getVisitorKeys:Hl(i)})]).flatMap(p=>s(p)?[p]:rp(p,e));return l.sort((p,d)=>n(p)-n(d)||a(p)-a(d)),tp.set(t,l),l}function Ay(t,e,r,s){let{locStart:i,locEnd:n}=r,a=i(e),l=n(e),c=rp(t,r),p,d,m=0,y=c.length;for(;m<y;){let g=m+y>>1,x=c[g],v=i(x),w=n(x);if(v<=a&&l<=w)return Ay(x,e,r,x);if(w<=a){p=x,m=g+1;continue}if(l<=v){d=x,y=g;continue}throw new Error("Comment location overlaps with node location")}if((s==null?void 0:s.type)==="TemplateLiteral"){let{quasis:g}=s,x=ip(g,e,r);p&&ip(g,p,r)!==x&&(p=null),d&&ip(g,d,r)!==x&&(d=null)}return{enclosingNode:s,precedingNode:p,followingNode:d}}var sp=()=>!1;function ik(t,e){let{comments:r}=t;if(delete t.comments,!ek(r)||!e.printer.canAttachComment)return;let s=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:n={}},originalText:a}=e,{ownLine:l=sp,endOfLine:c=sp,remaining:p=sp}=n,d=r.map((m,y)=>({...Ay(t,m,e),comment:m,text:a,options:e,ast:t,isLastComment:r.length-1===y}));for(let[m,y]of d.entries()){let{comment:g,precedingNode:x,enclosingNode:v,followingNode:w,text:C,options:b,ast:k,isLastComment:Q}=y,F;if(i?F=[y]:(g.enclosingNode=v,g.precedingNode=x,g.followingNode=w,F=[g,C,b,k,Q]),nk(C,b,d,m))g.placement="ownLine",l(...F)||(w?eo(w,g):x?to(x,g):Ji(v||k,g));else if(ak(C,b,d,m))g.placement="endOfLine",c(...F)||(x?to(x,g):w?eo(w,g):Ji(v||k,g));else if(g.placement="remaining",!p(...F))if(x&&w){let $=s.length;$>0&&s[$-1].followingNode!==w&&Ey(s,b),s.push(y)}else x?to(x,g):w?eo(w,g):Ji(v||k,g)}if(Ey(s,e),!i)for(let m of r)delete m.precedingNode,delete m.enclosingNode,delete m.followingNode}var Cy=t=>!/[\S\n\u2028\u2029]/u.test(t);function nk(t,e,r,s){let{comment:i,precedingNode:n}=r[s],{locStart:a,locEnd:l}=e,c=a(i);if(n)for(let p=s-1;p>=0;p--){let{comment:d,precedingNode:m}=r[p];if(m!==n||!Cy(t.slice(l(d),c)))break;c=a(d)}return hi(t,c,{backwards:!0})}fu