@telia-ace/alliance-internal-node-utilities 1.1.1-next.0 → 2.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-26VIM55J.js → chunk-A5O3J5K5.js} +19 -19
- package/dist/chunk-RVFY4UX4.js +32 -0
- package/dist/compile-distribution.js +22 -13
- package/dist/index.d.ts +18 -25
- package/dist/index.js +3 -3
- package/dist/prompt-LQKYOZP6.js +45 -0
- package/package.json +4 -4
- package/dist/chunk-EBHULZEM.js +0 -32
- package/dist/chunk-JG7V63GM.js +0 -1
- package/dist/main-FN5JZTIU.js +0 -9
- package/dist/prompt-YMONYGAG.js +0 -45
package/dist/main-FN5JZTIU.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import"./chunk-JG7V63GM.js";function N(e,f=!1){let t=e.length,n=0,i="",o=0,g=16,c=0,r=0,l=0,p=0,k=0;function h(s,a){let u=0,d=0;for(;u<s||!a;){let y=e.charCodeAt(n);if(y>=48&&y<=57)d=d*16+y-48;else if(y>=65&&y<=70)d=d*16+y-65+10;else if(y>=97&&y<=102)d=d*16+y-97+10;else break;n++,u++}return u<s&&(d=-1),d}function b(s){n=s,i="",o=0,g=16,k=0}function T(){let s=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&B(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&B(e.charCodeAt(n)))for(n++;n<e.length&&B(e.charCodeAt(n));)n++;else return k=3,e.substring(s,n);let a=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&B(e.charCodeAt(n))){for(n++;n<e.length&&B(e.charCodeAt(n));)n++;a=n}else k=3;return e.substring(s,a)}function A(){let s="",a=n;for(;;){if(n>=t){s+=e.substring(a,n),k=2;break}let u=e.charCodeAt(n);if(u===34){s+=e.substring(a,n),n++;break}if(u===92){if(s+=e.substring(a,n),n++,n>=t){k=2;break}switch(e.charCodeAt(n++)){case 34:s+='"';break;case 92:s+="\\";break;case 47:s+="/";break;case 98:s+="\b";break;case 102:s+="\f";break;case 110:s+=`
|
|
2
|
-
`;break;case 114:s+="\r";break;case 116:s+=" ";break;case 117:let y=h(4,!0);y>=0?s+=String.fromCharCode(y):k=4;break;default:k=5}a=n;continue}if(u>=0&&u<=31)if(j(u)){s+=e.substring(a,n),k=2;break}else k=6;n++}return s}function v(){if(i="",k=0,o=n,r=c,p=l,n>=t)return o=t,g=17;let s=e.charCodeAt(n);if(W(s)){do n++,i+=String.fromCharCode(s),s=e.charCodeAt(n);while(W(s));return g=15}if(j(s))return n++,i+=String.fromCharCode(s),s===13&&e.charCodeAt(n)===10&&(n++,i+=`
|
|
3
|
-
`),c++,l=n,g=14;switch(s){case 123:return n++,g=1;case 125:return n++,g=2;case 91:return n++,g=3;case 93:return n++,g=4;case 58:return n++,g=6;case 44:return n++,g=5;case 34:return n++,i=A(),g=10;case 47:let a=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<t&&!j(e.charCodeAt(n));)n++;return i=e.substring(a,n),g=12}if(e.charCodeAt(n+1)===42){n+=2;let u=t-1,d=!1;for(;n<u;){let y=e.charCodeAt(n);if(y===42&&e.charCodeAt(n+1)===47){n+=2,d=!0;break}n++,j(y)&&(y===13&&e.charCodeAt(n)===10&&n++,c++,l=n)}return d||(n++,k=1),i=e.substring(a,n),g=13}return i+=String.fromCharCode(s),n++,g=16;case 45:if(i+=String.fromCharCode(s),n++,n===t||!B(e.charCodeAt(n)))return g=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=T(),g=11;default:for(;n<t&&L(s);)n++,s=e.charCodeAt(n);if(o!==n){switch(i=e.substring(o,n),i){case"true":return g=8;case"false":return g=9;case"null":return g=7}return g=16}return i+=String.fromCharCode(s),n++,g=16}}function L(s){if(W(s)||j(s))return!1;switch(s){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){let s;do s=v();while(s>=12&&s<=15);return s}return{setPosition:b,getPosition:()=>n,scan:f?w:v,getToken:()=>g,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>r,getTokenStartCharacter:()=>o-p,getTokenError:()=>k}}function W(e){return e===32||e===9}function j(e){return e===10||e===13}function B(e){return e>=48&&e<=57}var H;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(H||(H={}));function D(e,f,t){let n,i,o,g,c;if(f){for(g=f.offset,c=g+f.length,o=g;o>0&&!U(e,o-1);)o--;let s=c;for(;s<e.length&&!U(e,s);)s++;i=e.substring(o,s),n=re(i,t)}else i=e,n=0,o=0,g=0,c=e.length;let r=le(t,e),l=0,p=0,k;t.insertSpaces?k=I(" ",t.tabSize||4):k=" ";let h=N(i,!1),b=!1;function T(){return l>1?I(r,l)+I(k,n+p):r+I(k,n+p)}function A(){let s=h.scan();for(l=0;s===15||s===14;)s===14&&t.keepLines?l+=1:s===14&&(l=1),s=h.scan();return b=s===16||h.getTokenError()!==0,s}let v=[];function L(s,a,u){!b&&(!f||a<c&&u>g)&&e.substring(a,u)!==s&&v.push({offset:a,length:u-a,content:s})}let w=A();if(t.keepLines&&l>0&&L(I(r,l),0,0),w!==17){let s=h.getTokenOffset()+o,a=I(k,n);L(a,o,s)}for(;w!==17;){let s=h.getTokenOffset()+h.getTokenLength()+o,a=A(),u="",d=!1;for(;l===0&&(a===12||a===13);){let $=h.getTokenOffset()+o;L(" ",s,$),s=h.getTokenOffset()+h.getTokenLength()+o,d=a===12,u=d?T():"",a=A()}if(a===2)w!==1&&p--,t.keepLines&&l>0||!t.keepLines&&w!==1?u=T():t.keepLines&&(u=" ");else if(a===4)w!==3&&p--,t.keepLines&&l>0||!t.keepLines&&w!==3?u=T():t.keepLines&&(u=" ");else{switch(w){case 3:case 1:p++,t.keepLines&&l>0||!t.keepLines?u=T():u=" ";break;case 5:t.keepLines&&l>0||!t.keepLines?u=T():u=" ";break;case 12:u=T();break;case 13:l>0?u=T():d||(u=" ");break;case 6:t.keepLines&&l>0?u=T():d||(u=" ");break;case 10:t.keepLines&&l>0?u=T():a===6&&!d&&(u="");break;case 7:case 8:case 9:case 11:case 2:case 4:t.keepLines&&l>0?u=T():(a===12||a===13)&&!d?u=" ":a!==5&&a!==17&&(b=!0);break;case 16:b=!0;break}l>0&&(a===12||a===13)&&(u=T())}a===17&&(t.keepLines&&l>0?u=T():u=t.insertFinalNewline?r:"");let y=h.getTokenOffset()+o;L(u,s,y),w=a}return v}function I(e,f){let t="";for(let n=0;n<f;n++)t+=e;return t}function re(e,f){let t=0,n=0,i=f.tabSize||4;for(;t<e.length;){let o=e.charAt(t);if(o===" ")n++;else if(o===" ")n+=i;else break;t++}return Math.floor(n/i)}function le(e,f){for(let t=0;t<f.length;t++){let n=f.charAt(t);if(n==="\r")return t+1<f.length&&f.charAt(t+1)===`
|
|
4
|
-
`?`\r
|
|
5
|
-
`:"\r";if(n===`
|
|
6
|
-
`)return`
|
|
7
|
-
`}return e&&e.eol||`
|
|
8
|
-
`}function U(e,f){return`\r
|
|
9
|
-
`.indexOf(e.charAt(f))!==-1}var V;(function(e){e.DEFAULT={allowTrailingComma:!1}})(V||(V={}));function q(e,f){let t=[],n=new Object,i,o={value:{},offset:0,length:0,type:"object",parent:void 0},g=!1;function c(r,l,p,k){o.value=r,o.offset=l,o.length=p,o.type=k,o.colonOffset=void 0,i=o}try{F(e,{onObjectBegin:(r,l)=>{if(f<=r)throw n;i=void 0,g=f>r,t.push("")},onObjectProperty:(r,l,p)=>{if(f<l||(c(r,l,p,"property"),t[t.length-1]=r,f<=l+p))throw n},onObjectEnd:(r,l)=>{if(f<=r)throw n;i=void 0,t.pop()},onArrayBegin:(r,l)=>{if(f<=r)throw n;i=void 0,t.push(0)},onArrayEnd:(r,l)=>{if(f<=r)throw n;i=void 0,t.pop()},onLiteralValue:(r,l,p)=>{if(f<l||(c(r,l,p,Y(r)),f<=l+p))throw n},onSeparator:(r,l,p)=>{if(f<=l)throw n;if(r===":"&&i&&i.type==="property")i.colonOffset=l,g=!1,i=void 0;else if(r===","){let k=t[t.length-1];typeof k=="number"?t[t.length-1]=k+1:(g=!0,t[t.length-1]=""),i=void 0}}})}catch(r){if(r!==n)throw r}return{path:t,previousNode:i,isAtPropertyKey:g,matches:r=>{let l=0;for(let p=0;l<r.length&&p<t.length;p++)if(r[l]===t[p]||r[l]==="*")l++;else if(r[l]!=="**")return!1;return l===r.length}}}function G(e,f=[],t=V.DEFAULT){let n=null,i=[],o=[];function g(r){Array.isArray(i)?i.push(r):n!==null&&(i[n]=r)}return F(e,{onObjectBegin:()=>{let r={};g(r),o.push(i),i=r,n=null},onObjectProperty:r=>{n=r},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{let r=[];g(r),o.push(i),i=r,n=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:g,onError:(r,l,p)=>{f.push({error:r,offset:l,length:p})}},t),i[0]}function M(e,f=[],t=V.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(r){n.type==="property"&&(n.length=r-n.offset,n=n.parent)}function o(r){return n.children.push(r),r}F(e,{onObjectBegin:r=>{n=o({type:"object",offset:r,length:-1,parent:n,children:[]})},onObjectProperty:(r,l,p)=>{n=o({type:"property",offset:l,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:r,offset:l,length:p,parent:n})},onObjectEnd:(r,l)=>{i(r+l),n.length=r+l-n.offset,n=n.parent,i(r+l)},onArrayBegin:(r,l)=>{n=o({type:"array",offset:r,length:-1,parent:n,children:[]})},onArrayEnd:(r,l)=>{n.length=r+l-n.offset,n=n.parent,i(r+l)},onLiteralValue:(r,l,p)=>{o({type:Y(r),offset:l,length:p,parent:n,value:r}),i(l+p)},onSeparator:(r,l,p)=>{n.type==="property"&&(r===":"?n.colonOffset=l:r===","&&i(l))},onError:(r,l,p)=>{f.push({error:r,offset:l,length:p})}},t);let c=n.children[0];return c&&delete c.parent,c}function _(e,f){if(!e)return;let t=e;for(let n of f)if(typeof n=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let i=!1;for(let o of t.children)if(Array.isArray(o.children)&&o.children[0].value===n&&o.children.length===2){t=o.children[1],i=!0;break}if(!i)return}else{let i=n;if(t.type!=="array"||i<0||!Array.isArray(t.children)||i>=t.children.length)return;t=t.children[i]}return t}function z(e){if(!e.parent||!e.parent.children)return[];let f=z(e.parent);if(e.parent.type==="property"){let t=e.parent.children[0].value;f.push(t)}else if(e.parent.type==="array"){let t=e.parent.children.indexOf(e);t!==-1&&f.push(t)}return f}function J(e){switch(e.type){case"array":return e.children.map(J);case"object":let f=Object.create(null);for(let t of e.children){let n=t.children[1];n&&(f[t.children[0].value]=J(n))}return f;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function oe(e,f,t=!1){return f>=e.offset&&f<e.offset+e.length||t&&f===e.offset+e.length}function R(e,f,t=!1){if(oe(e,f,t)){let n=e.children;if(Array.isArray(n))for(let i=0;i<n.length&&n[i].offset<=f;i++){let o=R(n[i],f,t);if(o)return o}return e}}function F(e,f,t=V.DEFAULT){let n=N(e,!1),i=[];function o(m){return m?()=>m(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function g(m){return m?()=>m(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}function c(m){return m?O=>m(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function r(m){return m?O=>m(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}let l=g(f.onObjectBegin),p=r(f.onObjectProperty),k=o(f.onObjectEnd),h=g(f.onArrayBegin),b=o(f.onArrayEnd),T=r(f.onLiteralValue),A=c(f.onSeparator),v=o(f.onComment),L=c(f.onError),w=t&&t.disallowComments,s=t&&t.allowTrailingComma;function a(){for(;;){let m=n.scan();switch(n.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:w||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(m){case 12:case 13:w?u(10):v();break;case 16:u(1);break;case 15:case 14:break;default:return m}}}function u(m,O=[],Q=[]){if(L(m),O.length+Q.length>0){let S=n.getToken();for(;S!==17;){if(O.indexOf(S)!==-1){a();break}else if(Q.indexOf(S)!==-1)break;S=a()}}}function d(m){let O=n.getTokenValue();return m?T(O):(p(O),i.push(O)),a(),!0}function y(){switch(n.getToken()){case 11:let m=n.getTokenValue(),O=Number(m);isNaN(O)&&(u(2),O=0),T(O);break;case 7:T(null);break;case 8:T(!0);break;case 9:T(!1);break;default:return!1}return a(),!0}function $(){return n.getToken()!==10?(u(3,[],[2,5]),!1):(d(!1),n.getToken()===6?(A(":"),a(),x()||u(4,[],[2,5])):u(5,[],[2,5]),i.pop(),!0)}function ne(){l(),a();let m=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(m||u(4,[],[]),A(","),a(),n.getToken()===2&&s)break}else m&&u(6,[],[]);$()||u(4,[],[2,5]),m=!0}return k(),n.getToken()!==2?u(7,[2],[]):a(),!0}function te(){h(),a();let m=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||u(4,[],[]),A(","),a(),n.getToken()===4&&s)break}else O&&u(6,[],[]);m?(i.push(0),m=!1):i[i.length-1]++,x()||u(4,[],[4,5]),O=!0}return b(),m||i.pop(),n.getToken()!==4?u(8,[4],[]):a(),!0}function x(){switch(n.getToken()){case 3:return te();case 1:return ne();case 10:return d(!0);default:return y()}}return a(),n.getToken()===17?t.allowEmptyContent?!0:(u(4,[],[]),!1):x()?(n.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}function X(e,f){let t=N(e),n=[],i,o=0,g;do switch(g=t.getPosition(),i=t.scan(),i){case 12:case 13:case 17:o!==g&&n.push(e.substring(o,g)),f!==void 0&&n.push(t.getTokenValue().replace(/[^\r\n]/g,f)),o=t.getPosition();break}while(i!==17);return n.join("")}function Y(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}function Z(e,f,t,n){let i=f.slice(),g=M(e,[]),c,r;for(;i.length>0&&(r=i.pop(),c=_(g,i),c===void 0&&t!==void 0);)typeof r=="string"?t={[r]:t}:t=[t];if(c)if(c.type==="object"&&typeof r=="string"&&Array.isArray(c.children)){let l=_(c,[r]);if(l!==void 0)if(t===void 0){if(!l.parent)throw new Error("Malformed AST");let p=c.children.indexOf(l.parent),k,h=l.parent.offset+l.parent.length;if(p>0){let b=c.children[p-1];k=b.offset+b.length}else k=c.offset+1,c.children.length>1&&(h=c.children[1].offset);return E(e,{offset:k,length:h-k,content:""},n)}else return E(e,{offset:l.offset,length:l.length,content:JSON.stringify(t)},n);else{if(t===void 0)return[];let p=`${JSON.stringify(r)}: ${JSON.stringify(t)}`,k=n.getInsertionIndex?n.getInsertionIndex(c.children.map(b=>b.children[0].value)):c.children.length,h;if(k>0){let b=c.children[k-1];h={offset:b.offset+b.length,length:0,content:","+p}}else c.children.length===0?h={offset:c.offset+1,length:0,content:p}:h={offset:c.offset+1,length:0,content:p+","};return E(e,h,n)}}else if(c.type==="array"&&typeof r=="number"&&Array.isArray(c.children)){let l=r;if(l===-1){let p=`${JSON.stringify(t)}`,k;if(c.children.length===0)k={offset:c.offset+1,length:0,content:p};else{let h=c.children[c.children.length-1];k={offset:h.offset+h.length,length:0,content:","+p}}return E(e,k,n)}else if(t===void 0&&c.children.length>=0){let p=r,k=c.children[p],h;if(c.children.length===1)h={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===p){let b=c.children[p-1],T=b.offset+b.length,A=c.offset+c.length;h={offset:T,length:A-2-T,content:""}}else h={offset:k.offset,length:c.children[p+1].offset-k.offset,content:""};return E(e,h,n)}else if(t!==void 0){let p,k=`${JSON.stringify(t)}`;if(!n.isArrayInsertion&&c.children.length>r){let h=c.children[r];p={offset:h.offset,length:h.length,content:k}}else if(c.children.length===0||r===0)p={offset:c.offset+1,length:0,content:c.children.length===0?k:k+","};else{let h=r>c.children.length?c.children.length:r,b=c.children[h-1];p={offset:b.offset+b.length,length:0,content:","+k}}return E(e,p,n)}else throw new Error(`Can not ${t===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${l} as length is not sufficient`)}else throw new Error(`Can not add ${typeof r!="number"?"index":"property"} to parent of type ${c.type}`);else{if(t===void 0)throw new Error("Can not delete in empty document");return E(e,{offset:g?g.offset:0,length:g?g.length:0,content:JSON.stringify(t)},n)}}function E(e,f,t){if(!t.formattingOptions)return[f];let n=P(e,f),i=f.offset,o=f.offset+f.content.length;if(f.length===0||f.content.length===0){for(;i>0&&!U(n,i-1);)i--;for(;o<n.length&&!U(n,o);)o++}let g=D(n,{offset:i,length:o-i},{...t.formattingOptions,keepLines:!1});for(let r=g.length-1;r>=0;r--){let l=g[r];n=P(n,l),i=Math.min(i,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}let c=e.length-(n.length-o)-i;return[{offset:i,length:c,content:n.substring(i,o)}]}function P(e,f){return e.substring(0,f.offset)+f.content+e.substring(f.offset+f.length)}var ke=N,K;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(K||(K={}));var C;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(C||(C={}));var he=q,me=G,be=M,Te=_,de=R,ye=z,Oe=J,we=F,Ae=X,ee;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(ee||(ee={}));function Le(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function ve(e,f,t){return D(e,f,t)}function Ne(e,f,t,n){return Z(e,f,t,n)}function Ee(e,f){let t=f.slice(0).sort((i,o)=>{let g=i.offset-o.offset;return g===0?i.length-o.length:g}),n=e.length;for(let i=t.length-1;i>=0;i--){let o=t[i];if(o.offset+o.length<=n)e=P(e,o);else throw new Error("Overlapping edit");n=o.offset}return e}export{ee as ParseErrorCode,K as ScanError,C as SyntaxKind,Ee as applyEdits,ke as createScanner,Te as findNodeAtLocation,de as findNodeAtOffset,ve as format,he as getLocation,ye as getNodePath,Oe as getNodeValue,Ne as modify,me as parse,be as parseTree,Le as printParseErrorCode,Ae as stripComments,we as visit};
|
package/dist/prompt-YMONYGAG.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{a as i,c as K,d as P}from"./chunk-26VIM55J.js";import"./chunk-JG7V63GM.js";import{stdin as FD,stdout as rD}from"node:process";import z from"node:readline";import{WriteStream as iD}from"node:tty";import sD from"tty";var _="\x1B",a=`${_}[`,CD="\x07",k={to(t,u){return u?`${a}${u+1};${t+1}H`:`${a}${t+1}G`},move(t,u){let e="";return t<0?e+=`${a}${-t}D`:t>0&&(e+=`${a}${t}C`),u<0?e+=`${a}${-u}A`:u>0&&(e+=`${a}${u}B`),e},up:(t=1)=>`${a}${t}A`,down:(t=1)=>`${a}${t}B`,forward:(t=1)=>`${a}${t}C`,backward:(t=1)=>`${a}${t}D`,nextLine:(t=1)=>`${a}E`.repeat(t),prevLine:(t=1)=>`${a}F`.repeat(t),left:`${a}G`,hide:`${a}?25l`,show:`${a}?25h`,save:`${_}7`,restore:`${_}8`},nD={up:(t=1)=>`${a}S`.repeat(t),down:(t=1)=>`${a}T`.repeat(t)},ED={screen:`${a}2J`,up:(t=1)=>`${a}1J`.repeat(t),down:(t=1)=>`${a}J`.repeat(t),line:`${a}2K`,lineEnd:`${a}K`,lineStart:`${a}1K`,lines(t){let u="";for(let e=0;e<t;e++)u+=this.line+(e<t-1?k.up():"");return t&&(u+=k.left),u}},A={cursor:k,scroll:nD,erase:ED,beep:CD},I={exports:{}},oD=sD,aD=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||oD.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(t,u,e=t)=>F=>{let r=""+F,s=r.indexOf(u,t.length);return~s?t+Q(r,u,e,s)+u:t+r+u},Q=(t,u,e,F)=>{let r=t.substring(0,F)+e,s=t.substring(F+u.length),D=s.indexOf(u);return~D?r+Q(s,u,e,D):r+s},DD=(t=aD)=>({isColorSupported:t,reset:t?u=>`\x1B[0m${u}\x1B[0m`:String,bold:t?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?E("\x1B[3m","\x1B[23m"):String,underline:t?E("\x1B[4m","\x1B[24m"):String,inverse:t?E("\x1B[7m","\x1B[27m"):String,hidden:t?E("\x1B[8m","\x1B[28m"):String,strikethrough:t?E("\x1B[9m","\x1B[29m"):String,black:t?E("\x1B[30m","\x1B[39m"):String,red:t?E("\x1B[31m","\x1B[39m"):String,green:t?E("\x1B[32m","\x1B[39m"):String,yellow:t?E("\x1B[33m","\x1B[39m"):String,blue:t?E("\x1B[34m","\x1B[39m"):String,magenta:t?E("\x1B[35m","\x1B[39m"):String,cyan:t?E("\x1B[36m","\x1B[39m"):String,white:t?E("\x1B[37m","\x1B[39m"):String,gray:t?E("\x1B[90m","\x1B[39m"):String,bgBlack:t?E("\x1B[40m","\x1B[49m"):String,bgRed:t?E("\x1B[41m","\x1B[49m"):String,bgGreen:t?E("\x1B[42m","\x1B[49m"):String,bgYellow:t?E("\x1B[43m","\x1B[49m"):String,bgBlue:t?E("\x1B[44m","\x1B[49m"):String,bgMagenta:t?E("\x1B[45m","\x1B[49m"):String,bgCyan:t?E("\x1B[46m","\x1B[49m"):String,bgWhite:t?E("\x1B[47m","\x1B[49m"):String});I.exports=DD();I.exports.createColors=DD;var cD=I.exports,w=K(cD);function lD({onlyFirst:t=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,t?void 0:"g")}function uD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(lD(),"")}var T={},hD={get exports(){return T},set exports(t){T=t}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(F){var r=F.charCodeAt(0),s=F.length==2?F.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,D=r<<10|s,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(F){var r=this.eastAsianWidth(F);return r=="F"||r=="W"||r=="A"?2:1};function e(F){return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(F){for(var r=e(F),s=0,D=0;D<r.length;D++)s=s+this.characterLength(r[D]);return s},u.slice=function(F,r,s){textLen=u.length(F),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var D="",C=0,h=e(F),c=0;c<h.length;c++){var B=h[c],l=u.length(B);if(C>=r-(l==2?1:0))if(C+l<=s)D+=B;else break;C+=l}return D}})(hD);var BD=T,AD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};function $(t,u={}){if(typeof t!="string"||t.length===0||(u={ambiguousIsNarrow:!0,...u},t=uD(t),t.length===0))return 0;t=t.replace(AD()," ");let e=u.ambiguousIsNarrow?1:2,F=0;for(let r of t){let s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(BD.eastAsianWidth(r)){case"F":case"W":F+=2;break;case"A":F+=e;break;default:F+=1}}return F}var y=10,q=(t=0)=>u=>`\x1B[${u+t}m`,G=(t=0)=>u=>`\x1B[${38+t};5;${u}m`,H=(t=0)=>(u,e,F)=>`\x1B[${38+t};2;${u};${e};${F}m`,o={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(o.modifier);var mD=Object.keys(o.color),gD=Object.keys(o.bgColor);[...mD,...gD];function pD(){let t=new Map;for(let[u,e]of Object.entries(o)){for(let[F,r]of Object.entries(e))o[F]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[F]=o[F],t.set(r[0],r[1]);Object.defineProperty(o,u,{value:e,enumerable:!1})}return Object.defineProperty(o,"codes",{value:t,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi=q(),o.color.ansi256=G(),o.color.ansi16m=H(),o.bgColor.ansi=q(y),o.bgColor.ansi256=G(y),o.bgColor.ansi16m=H(y),Object.defineProperties(o,{rgbToAnsi256:{value:(u,e,F)=>u===e&&e===F?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(e/255*5)+Math.round(F/255*5),enumerable:!1},hexToRgb:{value:u=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!e)return[0,0,0];let[F]=e;F.length===3&&(F=[...F].map(s=>s+s).join(""));let r=Number.parseInt(F,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>o.rgbToAnsi256(...o.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let e,F,r;if(u>=232)e=((u-232)*10+8)/255,F=e,r=e;else{u-=16;let C=u%36;e=Math.floor(u/36)/5,F=Math.floor(C/6)/5,r=C%6/5}let s=Math.max(e,F,r)*2;if(s===0)return 30;let D=30+(Math.round(r)<<2|Math.round(F)<<1|Math.round(e));return s===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,e,F)=>o.ansi256ToAnsi(o.rgbToAnsi256(u,e,F)),enumerable:!1},hexToAnsi:{value:u=>o.ansi256ToAnsi(o.hexToAnsi256(u)),enumerable:!1}}),o}var dD=pD(),f=new Set(["\x1B","\x9B"]),$D=39,L="\x07",tD="[",bD="]",eD="m",N=`${bD}8;;`,Y=t=>`${f.values().next().value}${tD}${t}${eD}`,Z=t=>`${f.values().next().value}${N}${t}${L}`,vD=t=>t.split(" ").map(u=>$(u)),S=(t,u,e)=>{let F=[...u],r=!1,s=!1,D=$(uD(t[t.length-1]));for(let[C,h]of F.entries()){let c=$(h);if(D+c<=e?t[t.length-1]+=h:(t.push(h),D=0),f.has(h)&&(r=!0,s=F.slice(C+1).join("").startsWith(N)),r){s?h===L&&(r=!1,s=!1):h===eD&&(r=!1);continue}D+=c,D===e&&C<F.length-1&&(t.push(""),D=0)}!D&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},fD=t=>{let u=t.split(" "),e=u.length;for(;e>0&&!($(u[e-1])>0);)e--;return e===u.length?t:u.slice(0,e).join(" ")+u.slice(e).join("")},xD=(t,u,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let F="",r,s,D=vD(t),C=[""];for(let[c,B]of t.split(" ").entries()){e.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let l=$(C[C.length-1]);if(c!==0&&(l>=u&&(e.wordWrap===!1||e.trim===!1)&&(C.push(""),l=0),(l>0||e.trim===!1)&&(C[C.length-1]+=" ",l++)),e.hard&&D[c]>u){let g=u-l,b=1+Math.floor((D[c]-g-1)/u);Math.floor((D[c]-1)/u)<b&&C.push(""),S(C,B,u);continue}if(l+D[c]>u&&l>0&&D[c]>0){if(e.wordWrap===!1&&l<u){S(C,B,u);continue}C.push("")}if(l+D[c]>u&&e.wordWrap===!1){S(C,B,u);continue}C[C.length-1]+=B}e.trim!==!1&&(C=C.map(c=>fD(c)));let h=[...C.join(`
|
|
2
|
-
`)];for(let[c,B]of h.entries()){if(F+=B,f.has(B)){let{groups:g}=new RegExp(`(?:\\${tD}(?<code>\\d+)m|\\${N}(?<uri>.*)${L})`).exec(h.slice(c).join(""))||{groups:{}};if(g.code!==void 0){let b=Number.parseFloat(g.code);r=b===$D?void 0:b}else g.uri!==void 0&&(s=g.uri.length===0?void 0:g.uri)}let l=dD.codes.get(Number(r));h[c+1]===`
|
|
3
|
-
`?(s&&(F+=Z("")),r&&l&&(F+=Y(l))):B===`
|
|
4
|
-
`&&(r&&l&&(F+=Y(r)),s&&(F+=Z(s)))}return F};function J(t,u,e){return String(t).normalize().replace(/\r\n/g,`
|
|
5
|
-
`).split(`
|
|
6
|
-
`).map(F=>xD(F,u,e)).join(`
|
|
7
|
-
`)}function wD(t,u){if(t===u)return;let e=t.split(`
|
|
8
|
-
`),F=u.split(`
|
|
9
|
-
`),r=[];for(let s=0;s<Math.max(e.length,F.length);s++)e[s]!==F[s]&&r.push(s);return r}var yD=Symbol("clack:cancel");function v(t,u){t.isTTY&&t.setRawMode(u)}var U=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),SD=new Set(["up","down","left","right","space","enter"]),p=class{constructor({render:u,input:e=FD,output:F=rD,...r},s=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=s,this.input=e,this.output=F}prompt(){let u=new iD(0);return u._write=(e,F,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(u),this.rl=z.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),z.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),v(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((e,F)=>{this.once("submit",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),v(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),v(this.input,!1),e(yD)})})}on(u,e){let F=this.subscribers.get(u)??[];F.push({cb:e}),this.subscribers.set(u,F)}once(u,e){let F=this.subscribers.get(u)??[];F.push({cb:e,once:!0}),this.subscribers.set(u,F)}emit(u,...e){let F=this.subscribers.get(u)??[],r=[];for(let s of F)s.cb(...e),s.once&&r.push(()=>F.splice(F.indexOf(s),1));for(let s of r)s()}unsubscribe(){this.subscribers.clear()}onKeypress(u,e){if(this.state==="error"&&(this.state="active"),e?.name&&!this._track&&U.has(e.name)&&this.emit("cursor",U.get(e.name)),e?.name&&SD.has(e.name)&&this.emit("cursor",e.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u&&this.emit("key",u.toLowerCase()),e?.name==="return"){if(this.opts.validate){let F=this.opts.validate(this.value);F&&(this.error=F,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
10
|
-
`),v(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let u=J(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
11
|
-
`).length-1;this.output.write(A.cursor.move(-999,u*-1))}render(){let u=J(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(A.cursor.hide);else{let e=wD(this._prevFrame,u);if(this.restoreCursor(),e&&e?.length===1){let F=e[0];this.output.write(A.cursor.move(0,F)),this.output.write(A.erase.lines(1));let r=u.split(`
|
|
12
|
-
`);this.output.write(r[F]),this._prevFrame=u,this.output.write(A.cursor.move(0,r.length-F-1));return}else if(e&&e?.length>1){let F=e[0];this.output.write(A.cursor.move(0,F)),this.output.write(A.erase.down());let r=u.split(`
|
|
13
|
-
`).slice(F);this.output.write(r.join(`
|
|
14
|
-
`)),this._prevFrame=u;return}this.output.write(A.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}},V=class extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(A.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},j=class extends p{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===u.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let u=this.value.length===this.options.length;this.value=u?[]:this.options.map(e=>e.value)}toggleValue(){let u=this.value.includes(this._value);this.value=u?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},M=class extends p{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.cursor=this.options.findIndex(({value:e})=>e===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},O=class extends p{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${w.inverse(w.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),F=this.value.slice(this.cursor);this.valueWithCursor=`${e}${w.inverse(F[0])}${F.slice(1)}`}})}get cursor(){return this._cursor}},_D=P(),m=(t,u)=>_D?t:u,kD=m("\u276F",">"),TD=m("\u25A0","x"),VD=m("\u25B2","x"),jD=m("\u2714","\u221A"),n="",d="",W=m("\u25CF",">"),R=m("\u25CB"," "),MD=m("\u25FB","[\u2022]"),X=m("\u25FC","[+]"),OD=m("\u25FB","[ ]"),x=t=>{switch(t){case"initial":case"active":return i.cyan(kD);case"cancel":return i.red(TD);case"error":return i.yellow(VD);case"submit":return i.green(jD)}},WD=t=>new O({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let u=`${i.gray(n)}
|
|
15
|
-
${x(this.state)} ${t.message}
|
|
16
|
-
`,e=t.placeholder?i.inverse(t.placeholder[0])+i.dim(t.placeholder.slice(1)):i.inverse(i.hidden("_")),F=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${u.trim()}
|
|
17
|
-
${i.yellow(n)} ${F}
|
|
18
|
-
${i.yellow(d)} ${i.yellow(this.error)}
|
|
19
|
-
`;case"submit":return`${u}${i.gray(n)} ${i.dim(this.value||t.placeholder)}`;case"cancel":return`${u}${i.gray(n)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?`
|
|
20
|
-
`+i.gray(n):""}`;default:return`${u}${i.cyan(n)} ${F}
|
|
21
|
-
${i.cyan(d)}
|
|
22
|
-
`}}}).prompt(),RD=t=>{let u=t.active??"Yes",e=t.inactive??"No";return new V({active:u,inactive:e,initialValue:t.initialValue??!0,render(){let F=`${i.gray(n)}
|
|
23
|
-
${x(this.state)} ${t.message}
|
|
24
|
-
`,r=this.value?u:e;switch(this.state){case"submit":return`${F}${i.gray(n)} ${i.dim(r)}`;case"cancel":return`${F}${i.gray(n)} ${i.strikethrough(i.dim(r))}
|
|
25
|
-
${i.gray(n)}`;default:return`${F}${i.cyan(n)} ${this.value?`${i.green(W)} ${u}`:`${i.dim(R)} ${i.dim(u)}`} ${i.dim("/")} ${this.value?`${i.dim(R)} ${i.dim(e)}`:`${i.green(W)} ${e}`}
|
|
26
|
-
${i.cyan(d)}
|
|
27
|
-
`}}}).prompt()},ID=t=>{let u=(e,F)=>{let r=e.label??String(e.value);switch(F){case"active":return`${i.green(W)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"selected":return`${i.dim(r)}`;case"cancelled":return`${i.strikethrough(i.dim(r))}`}return`${i.dim(R)} ${i.dim(r)}`};return new M({options:t.options,initialValue:t.initialValue,render(){let e=`${i.gray(n)}
|
|
28
|
-
${x(this.state)} ${t.message}
|
|
29
|
-
`;switch(this.state){case"submit":return`${e}${i.gray(n)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${i.gray(n)} ${u(this.options[this.cursor],"cancelled")}
|
|
30
|
-
${i.gray(n)}`;default:return`${e}${i.cyan(n)} ${this.options.map((F,r)=>u(F,r===this.cursor?"active":"inactive")).join(`
|
|
31
|
-
${i.cyan(n)} `)}
|
|
32
|
-
${i.cyan(d)}
|
|
33
|
-
`}}}).prompt()},LD=t=>{let u=(e,F)=>{let r=e.label??String(e.value);switch(F){case"active":return`${i.cyan(MD)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"selected":return`${i.green(X)} ${i.dim(r)}`;case"cancelled":return`${i.strikethrough(i.dim(r))}`;case"active-selected":return`${i.green(X)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"submitted":return`${i.dim(r)}`}return`${i.dim(OD)} ${i.dim(r)}`};return new j({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
34
|
-
${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(n)}
|
|
35
|
-
${x(this.state)} ${t.message}
|
|
36
|
-
`;switch(this.state){case"submit":return`${e}${i.gray(n)} ${this.options.filter(({value:F})=>this.value.includes(F)).map(F=>u(F,"submitted")).join(i.dim(", "))||i.dim("none")}`;case"cancel":{let F=this.options.filter(({value:r})=>this.value.includes(r)).map(r=>u(r,"cancelled")).join(i.dim(", "));return`${e}${i.gray(n)} ${F.trim()?`${F}
|
|
37
|
-
${i.gray(n)}`:""}`}case"error":{let F=this.error.split(`
|
|
38
|
-
`).map((r,s)=>s===0?`${i.yellow(d)} ${i.yellow(r)}`:` ${r}`).join(`
|
|
39
|
-
`);return e+i.yellow(n)+" "+this.options.map((r,s)=>{let D=this.value.includes(r.value),C=s===this.cursor;return C&&D?u(r,"active-selected"):D?u(r,"selected"):u(r,C?"active":"inactive")}).join(`
|
|
40
|
-
${i.yellow(n)} `)+`
|
|
41
|
-
`+F+`
|
|
42
|
-
`}default:return`${e}${i.cyan(n)} ${this.options.map((F,r)=>{let s=this.value.includes(F.value),D=r===this.cursor;return D&&s?u(F,"active-selected"):s?u(F,"selected"):u(F,D?"active":"inactive")}).join(`
|
|
43
|
-
${i.cyan(n)} `)}
|
|
44
|
-
${i.cyan(d)}
|
|
45
|
-
`}}}).prompt()};async function ZD(t,u={}){if(!u.type||u.type==="text")return await WD({message:t,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial});if(u.type==="confirm")return await RD({message:t,initialValue:u.initial});if(u.type==="select")return await ID({message:t,options:u.options.map(e=>typeof e=="string"?{value:e,label:e}:e)});if(u.type==="multiselect")return await LD({message:t,options:u.options.map(e=>typeof e=="string"?{value:e,label:e}:e),required:u.required});throw new Error(`Unknown prompt type: ${u.type}`)}export{ZD as prompt};
|