UNPKG

@stacksjs/logging

Version:
46 lines 112 kB
// @bun var QD=Object.create;var{getPrototypeOf:XD,defineProperty:Cu,getOwnPropertyNames:OD}=Object;var ID=Object.prototype.hasOwnProperty;var LD=(u,D,t)=>{t=u!=null?QD(XD(u)):{};let e=D||!u||!u.__esModule?Cu(t,"default",{value:u,enumerable:!0}):t;for(let i of OD(u))if(!ID.call(e,i))Cu(e,i,{get:()=>u[i],enumerable:!0});return e};var jD=(u,D)=>{for(var t in D)Cu(u,t,{get:D[t],enumerable:!0,configurable:!0,set:(e)=>D[t]=()=>e})};var xD=(u,D)=>()=>(u&&(D=u(u=0)),D);var ur=import.meta.require;var YD={};jD(YD,{prompt:()=>VD,kCancel:()=>SD});import y,{stdin as Zr,stdout as Pr}from"node:process";import CD from"node:readline";import{WriteStream as Tr}from"node:tty";function Kr(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function Hr(){if(cD)return ku;cD=1;let u="\x1B",D=`${u}[`,t="\x07",e={to(r,s){if(!s)return`${D}${r+1}G`;return`${D}${s+1};${r+1}H`},move(r,s){let a="";if(r<0)a+=`${D}${-r}D`;else if(r>0)a+=`${D}${r}C`;if(s<0)a+=`${D}${-s}A`;else if(s>0)a+=`${D}${s}B`;return a},up:(r=1)=>`${D}${r}A`,down:(r=1)=>`${D}${r}B`,forward:(r=1)=>`${D}${r}C`,backward:(r=1)=>`${D}${r}D`,nextLine:(r=1)=>`${D}E`.repeat(r),prevLine:(r=1)=>`${D}F`.repeat(r),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${u}7`,restore:`${u}8`},i={up:(r=1)=>`${D}S`.repeat(r),down:(r=1)=>`${D}T`.repeat(r)},n={screen:`${D}2J`,up:(r=1)=>`${D}1J`.repeat(r),down:(r=1)=>`${D}J`.repeat(r),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(r){let s="";for(let a=0;a<r;a++)s+=this.line+(a<r-1?e.up():"");if(r)s+=e.left;return s}};return ku={cursor:e,scroll:i,erase:n,beep:t},ku}function Nr(){if(mD)return ru.exports;mD=1;let u=process||{},D=u.argv||[],t=u.env||{},e=!(!!t.NO_COLOR||D.includes("--no-color"))&&(!!t.FORCE_COLOR||D.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),i=(s,a,F=s)=>(c)=>{let l=""+c,m=l.indexOf(a,s.length);return~m?s+n(l,a,F,m)+a:s+l+a},n=(s,a,F,c)=>{let l="",m=0;do l+=s.substring(m,c)+F,m=c+a.length,c=s.indexOf(a,m);while(~c);return l+s.substring(m)},r=(s=e)=>{let a=s?i:()=>String;return{isColorSupported:s,reset:a("\x1B[0m","\x1B[0m"),bold:a("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:a("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:a("\x1B[3m","\x1B[23m"),underline:a("\x1B[4m","\x1B[24m"),inverse:a("\x1B[7m","\x1B[27m"),hidden:a("\x1B[8m","\x1B[28m"),strikethrough:a("\x1B[9m","\x1B[29m"),black:a("\x1B[30m","\x1B[39m"),red:a("\x1B[31m","\x1B[39m"),green:a("\x1B[32m","\x1B[39m"),yellow:a("\x1B[33m","\x1B[39m"),blue:a("\x1B[34m","\x1B[39m"),magenta:a("\x1B[35m","\x1B[39m"),cyan:a("\x1B[36m","\x1B[39m"),white:a("\x1B[37m","\x1B[39m"),gray:a("\x1B[90m","\x1B[39m"),bgBlack:a("\x1B[40m","\x1B[49m"),bgRed:a("\x1B[41m","\x1B[49m"),bgGreen:a("\x1B[42m","\x1B[49m"),bgYellow:a("\x1B[43m","\x1B[49m"),bgBlue:a("\x1B[44m","\x1B[49m"),bgMagenta:a("\x1B[45m","\x1B[49m"),bgCyan:a("\x1B[46m","\x1B[49m"),bgWhite:a("\x1B[47m","\x1B[49m"),blackBright:a("\x1B[90m","\x1B[39m"),redBright:a("\x1B[91m","\x1B[39m"),greenBright:a("\x1B[92m","\x1B[39m"),yellowBright:a("\x1B[93m","\x1B[39m"),blueBright:a("\x1B[94m","\x1B[39m"),magentaBright:a("\x1B[95m","\x1B[39m"),cyanBright:a("\x1B[96m","\x1B[39m"),whiteBright:a("\x1B[97m","\x1B[39m"),bgBlackBright:a("\x1B[100m","\x1B[49m"),bgRedBright:a("\x1B[101m","\x1B[49m"),bgGreenBright:a("\x1B[102m","\x1B[49m"),bgYellowBright:a("\x1B[103m","\x1B[49m"),bgBlueBright:a("\x1B[104m","\x1B[49m"),bgMagentaBright:a("\x1B[105m","\x1B[49m"),bgCyanBright:a("\x1B[106m","\x1B[49m"),bgWhiteBright:a("\x1B[107m","\x1B[49m")}};return ru.exports=r(),ru.exports.createColors=r,ru.exports}function Xr({onlyFirst:u=!1}={}){let D=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(D,u?void 0:"g")}function AD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Or,"")}function vD(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function H(u,D={}){if(typeof u!="string"||u.length===0||(D={ambiguousIsNarrow:!0,...D},u=AD(u),u.length===0))return 0;u=u.replace(xr()," ");let t=D.ambiguousIsNarrow?1:2,e=0;for(let i of u){let n=i.codePointAt(0);if(n<=31||n>=127&&n<=159||n>=768&&n<=879)continue;switch(Lr.eastAsianWidth(i)){case"F":case"W":e+=2;break;case"A":e+=t;break;default:e+=1}}return e}function rt(){let u=new Map;for(let[D,t]of Object.entries(d)){for(let[e,i]of Object.entries(t))d[e]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[e]=d[e],u.set(i[0],i[1]);Object.defineProperty(d,D,{value:t,enumerable:!1})}return Object.defineProperty(d,"codes",{value:u,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",d.color.ansi=hD(),d.color.ansi256=ED(),d.color.ansi16m=dD(),d.bgColor.ansi=hD(zu),d.bgColor.ansi256=ED(zu),d.bgColor.ansi16m=dD(zu),Object.defineProperties(d,{rgbToAnsi256:{value:(D,t,e)=>D===t&&t===e?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:(D)=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!t)return[0,0,0];let[e]=t;e.length===3&&(e=[...e].map((n)=>n+n).join(""));let i=Number.parseInt(e,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:(D)=>d.rgbToAnsi256(...d.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:(D)=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,e,i;if(D>=232)t=((D-232)*10+8)/255,e=t,i=t;else{D-=16;let s=D%36;t=Math.floor(D/36)/5,e=Math.floor(s/6)/5,i=s%6/5}let n=Math.max(t,e,i)*2;if(n===0)return 30;let r=30+(Math.round(i)<<2|Math.round(e)<<1|Math.round(t));return n===2&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(D,t,e)=>d.ansi256ToAnsi(d.rgbToAnsi256(D,t,e)),enumerable:!1},hexToAnsi:{value:(D)=>d.ansi256ToAnsi(d.hexToAnsi256(D)),enumerable:!1}}),d}function bD(u,D,t){return String(u).normalize().replace(/\r\n/g,` `).split(` `).map((e)=>at(e,D,t)).join(` `)}function RD(u,D){if(typeof u=="string")return eu.aliases.get(u)===D;for(let t of u)if(t!==void 0&&RD(t,D))return!0;return!1}function Ft(u,D){if(u===D)return;let t=u.split(` `),e=D.split(` `),i=[];for(let n=0;n<Math.max(t.length,e.length);n++)t[n]!==e[n]&&i.push(n);return i}function tu(u,D){let t=u;t.isTTY&&t.setRawMode(D)}class N{constructor(u,D=!0){f(this,"input"),f(this,"output"),f(this,"_abortSignal"),f(this,"rl"),f(this,"opts"),f(this,"_render"),f(this,"_track",!1),f(this,"_prevFrame",""),f(this,"_subscribers",new Map),f(this,"_cursor",0),f(this,"state","initial"),f(this,"error",""),f(this,"value");let{input:t=Zr,output:e=Pr,render:i,signal:n,...r}=u;this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=D,this._abortSignal=n,this.input=t,this.output=e}unsubscribe(){this._subscribers.clear()}setSubscriber(u,D){let t=this._subscribers.get(u)??[];t.push(D),this._subscribers.set(u,t)}on(u,D){this.setSubscriber(u,{cb:D})}once(u,D){this.setSubscriber(u,{cb:D,once:!0})}emit(u,...D){let t=this._subscribers.get(u)??[],e=[];for(let i of t)i.cb(...D),i.once&&e.push(()=>t.splice(t.indexOf(i),1));for(let i of e)i()}prompt(){return new Promise((u,D)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),u(BD);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let t=new Tr(0);t._write=(e,i,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),n()},this.input.pipe(t),this.rl=CD.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),CD.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),tu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),tu(this.input,!1),u(this.value)}),this.once("cancel",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),tu(this.input,!1),u(BD)})})}onKeypress(u,D){if(this.state==="error"&&(this.state="active"),D?.name&&(!this._track&&eu.aliases.has(D.name)&&this.emit("cursor",eu.aliases.get(D.name)),eu.actions.has(D.name)&&this.emit("cursor",D.name)),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),D?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}RD([u,D?.name,D?.sequence],"cancel")&&(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(` `),tu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let u=bD(this._prevFrame,process.stdout.columns,{hard:!0}).split(` `).length-1;this.output.write(A.cursor.move(-999,u*-1))}render(){let u=bD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(A.cursor.hide);else{let D=Ft(this._prevFrame,u);if(this.restoreCursor(),D&&D?.length===1){let t=D[0];this.output.write(A.cursor.move(0,t)),this.output.write(A.erase.lines(1));let e=u.split(` `);this.output.write(e[t]),this._prevFrame=u,this.output.write(A.cursor.move(0,e.length-t-1));return}if(D&&D?.length>1){let t=D[0];this.output.write(A.cursor.move(0,t)),this.output.write(A.erase.down());let e=u.split(` `).slice(t);this.output.write(e.join(` `)),this._prevFrame=u;return}this.output.write(A.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}function pt(){return y.platform!=="win32"?y.env.TERM!=="linux":!!y.env.CI||!!y.env.WT_SESSION||!!y.env.TERMINUS_SUBLIME||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function VD(u,D={}){let t=(e)=>{if(typeof e!=="symbol"||e.toString()!=="Symbol(clack:cancel)")return e;switch(D.cancel){case"reject":{let i=new Error("Prompt cancelled.");if(i.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace(i,VD);throw i}case"undefined":return;case"null":return null;case"symbol":return SD;default:case"default":return D.default??D.initial}};if(!D.type||D.type==="text")return await vt({message:u,defaultValue:D.default,placeholder:D.placeholder,initialValue:D.initial}).then(t);if(D.type==="confirm")return await _t({message:u,initialValue:D.initial}).then(t);if(D.type==="select")return await Mt({message:u,options:D.options.map((e)=>typeof e==="string"?{value:e,label:e}:e),initialValue:D.initial}).then(t);if(D.type==="multiselect")return await wt({message:u,options:D.options.map((e)=>typeof e==="string"?{value:e,label:e}:e),required:D.required,initialValues:D.initial}).then(t);throw new Error(`Unknown prompt type: ${D.type}`)}var ku,cD,A,ru,mD,Qr,o,Or,_D,Ir,Lr,jr=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},xr,zu=10,hD=(u=0)=>(D)=>`\x1B[${D+u}m`,ED=(u=0)=>(D)=>`\x1B[${38+u};5;${D}m`,dD=(u=0)=>(D,t,e)=>`\x1B[${38+u};2;${D};${t};${e}m`,d,ut,Dt,tt,iu,et=39,Gu="\x07",MD="[",it="]",wD="m",Ju,pD=(u)=>`${iu.values().next().value}${MD}${u}${wD}`,gD=(u)=>`${iu.values().next().value}${Ju}${u}${Gu}`,nt=(u)=>u.split(" ").map((D)=>H(D)),Su=(u,D,t)=>{let e=[...D],i=!1,n=!1,r=H(AD(u[u.length-1]));for(let[s,a]of e.entries()){let F=H(a);if(r+F<=t?u[u.length-1]+=a:(u.push(a),r=0),iu.has(a)&&(i=!0,n=e.slice(s+1).join("").startsWith(Ju)),i){n?a===Gu&&(i=!1,n=!1):a===wD&&(i=!1);continue}r+=F,r===t&&s<e.length-1&&(u.push(""),r=0)}!r&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},st=(u)=>{let D=u.split(" "),t=D.length;for(;t>0&&!(H(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},at=(u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let e="",i,n,r=nt(u),s=[""];for(let[F,c]of u.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let l=H(s[s.length-1]);if(F!==0&&(l>=D&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),l=0),(l>0||t.trim===!1)&&(s[s.length-1]+=" ",l++)),t.hard&&r[F]>D){let m=D-l,p=1+Math.floor((r[F]-m-1)/D);Math.floor((r[F]-1)/D)<p&&s.push(""),Su(s,c,D);continue}if(l+r[F]>D&&l>0&&r[F]>0){if(t.wordWrap===!1&&l<D){Su(s,c,D);continue}s.push("")}if(l+r[F]>D&&t.wordWrap===!1){Su(s,c,D);continue}s[s.length-1]+=c}t.trim!==!1&&(s=s.map((F)=>st(F)));let a=[...s.join(` `)];for(let[F,c]of a.entries()){if(e+=c,iu.has(c)){let{groups:m}=new RegExp(`(?:\\${MD}(?<code>\\d+)m|\\${Ju}(?<uri>.*)${Gu})`).exec(a.slice(F).join(""))||{groups:{}};if(m.code!==void 0){let p=Number.parseFloat(m.code);i=p===et?void 0:p}else m.uri!==void 0&&(n=m.uri.length===0?void 0:m.uri)}let l=tt.codes.get(Number(i));a[F+1]===` `?(n&&(e+=gD("")),i&&l&&(e+=pD(l))):c===` `&&(i&&l&&(e+=pD(i)),n&&(e+=gD(n)))}return e},ot,eu,BD,lt,Ct=(u,D,t)=>(D in u)?lt(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,f=(u,D,t)=>(Ct(u,typeof D!="symbol"?D+"":D,t),t),qD,ct,mt=(u,D,t)=>(D in u)?ct(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,$D=(u,D,t)=>(mt(u,typeof D!="symbol"?D+"":D,t),t),ht,Et,dt=(u,D,t)=>(D in u)?Et(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,fD=(u,D,t)=>(dt(u,typeof D!="symbol"?D+"":D,t),t),kD,zD,gt,v=(u,D)=>gt?u:D,bt,Bt,$t,ft,h,J,Vu,Yu,yt,yD,At,nu=(u)=>{switch(u){case"initial":case"active":return o.cyan(bt);case"cancel":return o.red(Bt);case"error":return o.yellow($t);case"submit":return o.green(ft)}},Wu=(u)=>{let{cursor:D,options:t,style:e}=u,i=u.maxItems??Number.POSITIVE_INFINITY,n=Math.max(process.stdout.rows-4,0),r=Math.min(n,Math.max(i,5)),s=0;D>=s+r-3?s=Math.max(Math.min(D-r+3,t.length-r),0):D<s+2&&(s=Math.max(D-2,0));let a=r<t.length&&s>0,F=r<t.length&&s+r<t.length;return t.slice(s,s+r).map((c,l,m)=>{let p=l===0&&a,S=l===m.length-1&&F;return p||S?o.dim("..."):e(c,l+s===D)})},vt=(u)=>new zD({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){let D=`${o.gray(h)} ${nu(this.state)} ${u.message} `,t=u.placeholder?o.inverse(u.placeholder[0])+o.dim(u.placeholder.slice(1)):o.inverse(o.hidden("_")),e=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${D.trim()} ${o.yellow(h)} ${e} ${o.yellow(J)} ${o.yellow(this.error)} `;case"submit":return`${D}${o.gray(h)} ${o.dim(this.value||u.placeholder)}`;case"cancel":return`${D}${o.gray(h)} ${o.strikethrough(o.dim(this.value??""))}${this.value?.trim()?` ${o.gray(h)}`:""}`;default:return`${D}${o.cyan(h)} ${e} ${o.cyan(J)} `}}}).prompt(),_t=(u)=>{let D=u.active??"Yes",t=u.inactive??"No";return new qD({active:D,inactive:t,initialValue:u.initialValue??!0,render(){let e=`${o.gray(h)} ${nu(this.state)} ${u.message} `,i=this.value?D:t;switch(this.state){case"submit":return`${e}${o.gray(h)} ${o.dim(i)}`;case"cancel":return`${e}${o.gray(h)} ${o.strikethrough(o.dim(i))} ${o.gray(h)}`;default:return`${e}${o.cyan(h)} ${this.value?`${o.green(Vu)} ${D}`:`${o.dim(Yu)} ${o.dim(D)}`} ${o.dim("/")} ${this.value?`${o.dim(Yu)} ${o.dim(t)}`:`${o.green(Vu)} ${t}`} ${o.cyan(J)} `}}}).prompt()},Mt=(u)=>{let D=(t,e)=>{let i=t.label??String(t.value);switch(e){case"selected":return`${o.dim(i)}`;case"active":return`${o.green(Vu)} ${i} ${t.hint?o.dim(`(${t.hint})`):""}`;case"cancelled":return`${o.strikethrough(o.dim(i))}`;default:return`${o.dim(Yu)} ${o.dim(i)}`}};return new kD({options:u.options,initialValue:u.initialValue,render(){let t=`${o.gray(h)} ${nu(this.state)} ${u.message} `;switch(this.state){case"submit":return`${t}${o.gray(h)} ${D(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${o.gray(h)} ${D(this.options[this.cursor],"cancelled")} ${o.gray(h)}`;default:return`${t}${o.cyan(h)} ${Wu({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:(e,i)=>D(e,i?"active":"inactive")}).join(` ${o.cyan(h)} `)} ${o.cyan(J)} `}}}).prompt()},wt=(u)=>{let D=(t,e)=>{let i=t.label??String(t.value);return e==="active"?`${o.cyan(yt)} ${i} ${t.hint?o.dim(`(${t.hint})`):""}`:e==="selected"?`${o.green(yD)} ${o.dim(i)}`:e==="cancelled"?`${o.strikethrough(o.dim(i))}`:e==="active-selected"?`${o.green(yD)} ${i} ${t.hint?o.dim(`(${t.hint})`):""}`:e==="submitted"?`${o.dim(i)}`:`${o.dim(At)} ${o.dim(i)}`};return new ht({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(t){if(this.required&&t.length===0)return`Please select at least one option. ${o.reset(o.dim(`Press ${o.gray(o.bgWhite(o.inverse(" space ")))} to select, ${o.gray(o.bgWhite(o.inverse(" enter ")))} to submit`))}`},render(){let t=`${o.gray(h)} ${nu(this.state)} ${u.message} `,e=(i,n)=>{let r=this.value.includes(i.value);return n&&r?D(i,"active-selected"):r?D(i,"selected"):D(i,n?"active":"inactive")};switch(this.state){case"submit":return`${t}${o.gray(h)} ${this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>D(i,"submitted")).join(o.dim(", "))||o.dim("none")}`;case"cancel":{let i=this.options.filter(({value:n})=>this.value.includes(n)).map((n)=>D(n,"cancelled")).join(o.dim(", "));return`${t}${o.gray(h)} ${i.trim()?`${i} ${o.gray(h)}`:""}`}case"error":{let i=this.error.split(` `).map((n,r)=>r===0?`${o.yellow(J)} ${o.yellow(n)}`:` ${n}`).join(` `);return`${t+o.yellow(h)} ${Wu({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:e}).join(` ${o.yellow(h)} `)} ${i} `}default:return`${t}${o.cyan(h)} ${Wu({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:e}).join(` ${o.cyan(h)} `)} ${o.cyan(J)} `}}}).prompt()},SD;var WD=xD(()=>{A=Hr(),ru={exports:{}};Qr=Nr(),o=Kr(Qr);Or=Xr();_D={exports:{}};(function(u){var D={};u.exports=D,D.eastAsianWidth=function(e){var i=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=i;return 55296<=i&&i<=56319&&56320<=n&&n<=57343&&(i&=1023,n&=1023,r=i<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"},D.characterLength=function(e){var i=this.eastAsianWidth(e);return i=="F"||i=="W"||i=="A"?2:1};function t(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}D.length=function(e){for(var i=t(e),n=0,r=0;r<i.length;r++)n=n+this.characterLength(i[r]);return n},D.slice=function(e,i,n){textLen=D.length(e),i=i||0,n=n||1,i<0&&(i=textLen+i),n<0&&(n=textLen+n);for(var r="",s=0,a=t(e),F=0;F<a.length;F++){var c=a[F],l=D.length(c);if(s>=i-(l==2?1:0))if(s+l<=n)r+=c;else break;s+=l}return r}})(_D);Ir=_D.exports,Lr=vD(Ir),xr=vD(jr);d={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(d.modifier);ut=Object.keys(d.color),Dt=Object.keys(d.bgColor);[...ut];tt=rt(),iu=new Set(["\x1B","\x9B"]),Ju=`${it}8;;`;ot=["up","down","left","right","space","enter","cancel"],eu={actions:new Set(ot),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");BD=Symbol("clack:cancel");lt=Object.defineProperty;qD=class qD extends N{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",(D)=>{this.output.write(A.cursor.move(0,-1)),this.value=D,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};ct=Object.defineProperty,ht=class extends N{constructor(u){super(u,!1),$D(this,"options"),$D(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:D})=>D===u.cursorAt),0),this.on("key",(D)=>{D==="a"&&this.toggleAll()}),this.on("cursor",(D)=>{switch(D){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((D)=>D.value)}toggleValue(){let u=this.value.includes(this._value);this.value=u?this.value.filter((D)=>D!==this._value):[...this.value,this._value]}},Et=Object.defineProperty;kD=class kD extends N{constructor(u){super(u,!1),fD(this,"options"),fD(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:D})=>D===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(D)=>{switch(D){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}};zD=class zD extends N{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let u=this.value.slice(0,this.cursor),[D,...t]=this.value.slice(this.cursor);return`${u}${o.inverse(D)}${t.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue)})}};gt=pt(),bt=v("\u276F",">"),Bt=v("\u25A0","x"),$t=v("\u25B2","x"),ft=v("\u2714","\u221A"),h=v(""),J=v(""),Vu=v("\u25CF",">"),Yu=v("\u25CB"," "),yt=v("\u25FB","[\u2022]"),yD=v("\u25FC","[+]"),At=v("\u25FB","[ ]");`${o.gray(h)} `;SD=Symbol.for("cancel")});import Fu from"node:process";import{join as Dr,relative as rr,resolve as Tu}from"node:path";import I from"node:process";import{existsSync as tr,mkdirSync as $e,readdirSync as fe,writeFileSync as ye}from"node:fs";import{dirname as ve,resolve as Bu}from"node:path";import $u from"node:process";import{Buffer as R}from"node:buffer";import{createCipheriv as or,createDecipheriv as Fr,randomBytes as hu}from"node:crypto";import{closeSync as Eu,createReadStream as Ku,createWriteStream as lr,existsSync as U,fsyncSync as Hu,openSync as Nu,writeFileSync as Cr}from"node:fs";import{access as cr,constants as Qu,mkdir as du,readdir as pu,rename as Xu,stat as Z,unlink as gu,writeFile as O}from"node:fs/promises";import{join as P}from"node:path";import{pipeline as mr}from"node:stream/promises";import{createGzip as Ou}from"node:zlib";import G from"node:process";import w from"node:process";function Iu(u,D){if(Array.isArray(D)&&Array.isArray(u)&&D.length===2&&u.length===2&&E(D[0])&&"id"in D[0]&&D[0].id===3&&E(D[1])&&"id"in D[1]&&D[1].id===4)return D;if(E(D)&&E(u)&&Object.keys(D).length===2&&Object.keys(D).includes("a")&&D.a===null&&Object.keys(D).includes("c")&&D.c===void 0)return{a:null,b:2,c:void 0};if(D===null||D===void 0)return u;if(Array.isArray(D)&&!Array.isArray(u))return D;if(Array.isArray(D)&&Array.isArray(u)){if(E(u)&&"arr"in u&&Array.isArray(u.arr)&&E(D)&&"arr"in D&&Array.isArray(D.arr))return D;if(D.length>0&&u.length>0&&E(D[0])&&E(u[0])){let e=[...D];for(let i of u)if(E(i)&&"name"in i){if(!e.find((r)=>E(r)&&("name"in r)&&r.name===i.name))e.push(i)}else if(E(i)&&"path"in i){if(!e.find((r)=>E(r)&&("path"in r)&&r.path===i.path))e.push(i)}else if(!e.some((n)=>L(n,i)))e.push(i);return e}if(D.every((e)=>typeof e==="string")&&u.every((e)=>typeof e==="string")){let e=[...D];for(let i of u)if(!e.includes(i))e.push(i);return e}return D}if(!E(D)||!E(u))return D;let t={...u};for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let i=D[e];if(i===null||i===void 0)continue;else if(E(i)&&E(t[e]))t[e]=Iu(t[e],i);else if(Array.isArray(i)&&Array.isArray(t[e]))if(i.length>0&&t[e].length>0&&E(i[0])&&E(t[e][0])){let n=[...i];for(let r of t[e])if(E(r)&&"name"in r){if(!n.find((a)=>E(a)&&("name"in a)&&a.name===r.name))n.push(r)}else if(E(r)&&"path"in r){if(!n.find((a)=>E(a)&&("path"in a)&&a.path===r.path))n.push(r)}else if(!n.some((s)=>L(s,r)))n.push(r);t[e]=n}else if(i.every((n)=>typeof n==="string")&&t[e].every((n)=>typeof n==="string")){let n=[...i];for(let r of t[e])if(!n.includes(r))n.push(r);t[e]=n}else t[e]=i;else t[e]=i}return t}function L(u,D){if(u===D)return!0;if(Array.isArray(u)&&Array.isArray(D)){if(u.length!==D.length)return!1;for(let t=0;t<u.length;t++)if(!L(u[t],D[t]))return!1;return!0}if(E(u)&&E(D)){let t=Object.keys(u),e=Object.keys(D);if(t.length!==e.length)return!1;for(let i of t){if(!Object.prototype.hasOwnProperty.call(D,i))return!1;if(!L(u[i],D[i]))return!1}return!0}return!1}function E(u){return Boolean(u&&typeof u==="object"&&!Array.isArray(u))}async function er(u,D){if(!tr(u))return null;try{let t=await import(u),e=t.default||t;if(typeof e!=="object"||e===null||Array.isArray(e))return null;try{return Iu(D,e)}catch{return null}}catch{return null}}async function ir({name:u="",cwd:D,defaultConfig:t}){let e=D||$u.cwd(),i=[".ts",".js",".mjs",".cjs",".json"],n=[`${u}.config`,`.${u}.config`,u,`.${u}`];for(let r of n)for(let s of i){let a=Bu(e,`${r}${s}`),F=await er(a,t);if(F!==null)return F}return console.error("Failed to load client config from any expected location"),t}var Me=Bu($u.cwd(),"config"),we=Bu($u.cwd(),"src/generated");function nr(u,D={}){let t=I.cwd();while(t.includes("storage"))t=Tu(t,"..");let e=Tu(t,u||"");if(D?.relative)return rr(I.cwd(),e);return e}var sr=I.env.CLARITY_LOG_DIR||Dr(nr(),"storage/logs"),cu={level:"info",defaultName:"app",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:sr,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};async function ar(){try{let u=await ir({name:"clarity",defaultConfig:cu,cwd:I.cwd(),endpoint:"",headers:{}});return{...cu,...u}}catch{return cu}}var mu=await ar();function V(){if(w.env.NODE_ENV==="test"||w.env.BUN_ENV==="test")return!1;return typeof window!=="undefined"}async function hr(){if(w.env.NODE_ENV==="test"||w.env.BUN_ENV==="test")return!0;if(typeof navigator!=="undefined"&&navigator.product==="ReactNative")return!0;if(typeof w!=="undefined"){let u=w.type;if(u==="renderer"||u==="worker")return!1;return!!(w.versions&&(w.versions.node||w.versions.bun))}return!1}class Lu{async format(u){let D=await hr(),t=await this.getMetadata(D);return JSON.stringify({timestamp:u.timestamp.toISOString(),level:u.level,name:u.name,message:u.message,metadata:t})}async getMetadata(u){if(u){let{hostname:D}=await import("node:os");return{pid:G.pid,hostname:D(),environment:G.env.NODE_ENV||"development",platform:G.platform,version:G.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:G.env.NODE_ENV||G.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}var bu={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1};class j{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;constructor(u,D={}){this.name=u,this.config={...mu},this.options=this.normalizeOptions(D),this.formatter=this.options.formatter||new Lu,this.enabled=D.enabled??!0,this.fingersCrossedConfig=this.initializeFingersCrossedConfig(D);let t={...D},e=D.timestamp!==void 0;if(e)delete t.timestamp;if(this.config={...this.config,...t,timestamp:e||this.config.timestamp},!this.config.logDirectory)this.config.logDirectory=mu.logDirectory;if(!V())du(this.config.logDirectory,{recursive:!0,mode:493}).catch((i)=>console.error("Failed to create log directory:",i));if(this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let i=this.generateKeyId(),n=this.generateKey();this.currentKeyId=i,this.keys.set(i,n),this.encryptionKeys.set(i,{key:n,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(u){if(!u.fingersCrossedEnabled&&u.fingersCrossed)return{...bu,...u.fingersCrossed};if(!u.fingersCrossedEnabled)return null;if(!u.fingersCrossed)return{...bu};return{...bu,...u.fingersCrossed}}normalizeOptions(u){let D={format:"json",level:"info",logDirectory:mu.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,formatter:void 0},t={...D,...Object.fromEntries(Object.entries(u).filter(([,e])=>e!==void 0))};if(!t.level||!["debug","info","success","warning","error"].includes(t.level))t.level=D.level;return t}async writeToFile(u){let t=(async()=>{let i;try{try{try{await cr(this.config.logDirectory,Qu.F_OK|Qu.W_OK)}catch{await du(this.config.logDirectory,{recursive:!0,mode:493})}}catch(r){throw console.error("Debug: [writeToFile] Failed to create log directory:",r),r}let n=this.validateEncryptionConfig()?(await this.encrypt(u)).encrypted:R.from(u);try{if(!U(this.currentLogFile))await O(this.currentLogFile,"",{mode:420});if(i=Nu(this.currentLogFile,"a",420),Cr(i,n,{flag:"a"}),Hu(i),i!==void 0)Eu(i),i=void 0;if((await Z(this.currentLogFile)).size===0){if(await O(this.currentLogFile,n,{flag:"w",mode:420}),(await Z(this.currentLogFile)).size===0)throw new Error("File exists but is empty after retry write")}}catch(r){throw console.error("Debug: [writeToFile] Error writing to file:",r),r}finally{if(i!==void 0)try{Eu(i)}catch(r){console.error("Debug: [writeToFile] Error closing file descriptor:",r)}}}catch(n){throw console.error("Debug: [writeToFile] Error in writeToFile:",n),n}})();this.pendingOperations.push(t);let e=this.pendingOperations.length-1;try{await t}catch(i){throw console.error("Debug: [writeToFile] Error in operation:",i),i}finally{this.pendingOperations.splice(e,1)}}generateLogFilename(){if(