@stacksjs/queue
Version:
The Stacks Queue system.
19 lines (18 loc) • 7.75 MB
JavaScript
// @bun
var cd8=Object.create;var{getPrototypeOf:md8,defineProperty:Xx,getOwnPropertyNames:rp0,getOwnPropertyDescriptor:id8}=Object,np0=Object.prototype.hasOwnProperty;var W8=(F,$,D)=>{D=F!=null?cd8(md8(F)):{};let G=$||!F||!F.__esModule?Xx(D,"default",{value:F,enumerable:!0}):D;for(let E of rp0(F))if(!np0.call(G,E))Xx(G,E,{get:()=>F[E],enumerable:!0});return G},ap0=new WeakMap,sp0=(F)=>{var $=ap0.get(F),D;if($)return $;if($=Xx({},"__esModule",{value:!0}),F&&typeof F==="object"||typeof F==="function")rp0(F).map((G)=>!np0.call($,G)&&Xx($,G,{get:()=>F[G],enumerable:!(D=id8(F,G))||D.enumerable}));return ap0.set(F,$),$},s=(F,$)=>()=>($||F(($={exports:{}}).exports,$),$.exports);var o$=(F,$)=>{for(var D in $)Xx(F,D,{get:$[D],enumerable:!0,configurable:!0,set:(G)=>$[D]=()=>G})};var f=(F,$)=>()=>(F&&($=F(F=0)),$);var w1=import.meta.require;var tp0=()=>{};var op0=f(()=>{tp0()});var rP3,nP3;var ep0=f(()=>{rP3=process.argv,nP3=`${process.platform}-${process.arch} node-${process.version}`});var Fd0=f(()=>{ep0()});import{join as pd8,relative as dd8,resolve as $d0}from"node:path";import $d from"node:process";import{existsSync as ad8,mkdirSync as Gj3,readdirSync as Ej3,writeFileSync as Xj3}from"node:fs";import{dirname as Yj3,resolve as lD0}from"node:path";import pD0 from"node:process";import{Buffer as dR}from"node:buffer";import{createCipheriv as ed8,createDecipheriv as Fa8,randomBytes as yD0}from"node:crypto";import{closeSync as _D0,createReadStream as Dd0,createWriteStream as $a8,existsSync as Ux,fsyncSync as Gd0,openSync as Ed0,writeFileSync as Da8}from"node:fs";import{access as Ga8,constants as Xd0,mkdir as uD0,readdir as cD0,rename as Ud0,stat as Yx,unlink as mD0,writeFile as Fd}from"node:fs/promises";import{join as Wx}from"node:path";import{pipeline as Ea8}from"node:stream/promises";import{createGzip as Yd0}from"node:zlib";import GS from"node:process";import VH from"node:process";function Wd0(F,$){if(Array.isArray($)&&Array.isArray(F)&&$.length===2&&F.length===2&&g7($[0])&&"id"in $[0]&&$[0].id===3&&g7($[1])&&"id"in $[1]&&$[1].id===4)return $;if(g7($)&&g7(F)&&Object.keys($).length===2&&Object.keys($).includes("a")&&$.a===null&&Object.keys($).includes("c")&&$.c===void 0)return{a:null,b:2,c:void 0};if($===null||$===void 0)return F;if(Array.isArray($)&&!Array.isArray(F))return $;if(Array.isArray($)&&Array.isArray(F)){if(g7(F)&&"arr"in F&&Array.isArray(F.arr)&&g7($)&&"arr"in $&&Array.isArray($.arr))return $;if($.length>0&&F.length>0&&g7($[0])&&g7(F[0])){let G=[...$];for(let E of F)if(g7(E)&&"name"in E){if(!G.find((Y)=>g7(Y)&&("name"in Y)&&Y.name===E.name))G.push(E)}else if(g7(E)&&"path"in E){if(!G.find((Y)=>g7(Y)&&("path"in Y)&&Y.path===E.path))G.push(E)}else if(!G.some((X)=>Dd(X,E)))G.push(E);return G}if($.every((G)=>typeof G==="string")&&F.every((G)=>typeof G==="string")){let G=[...$];for(let E of F)if(!G.includes(E))G.push(E);return G}return $}if(!g7($)||!g7(F))return $;let D={...F};for(let G in $)if(Object.prototype.hasOwnProperty.call($,G)){let E=$[G];if(E===null||E===void 0)continue;else if(g7(E)&&g7(D[G]))D[G]=Wd0(D[G],E);else if(Array.isArray(E)&&Array.isArray(D[G]))if(E.length>0&&D[G].length>0&&g7(E[0])&&g7(D[G][0])){let X=[...E];for(let Y of D[G])if(g7(Y)&&"name"in Y){if(!X.find((Z)=>g7(Z)&&("name"in Z)&&Z.name===Y.name))X.push(Y)}else if(g7(Y)&&"path"in Y){if(!X.find((Z)=>g7(Z)&&("path"in Z)&&Z.path===Y.path))X.push(Y)}else if(!X.some((U)=>Dd(U,Y)))X.push(Y);D[G]=X}else if(E.every((X)=>typeof X==="string")&&D[G].every((X)=>typeof X==="string")){let X=[...E];for(let Y of D[G])if(!X.includes(Y))X.push(Y);D[G]=X}else D[G]=E;else D[G]=E}return D}function Dd(F,$){if(F===$)return!0;if(Array.isArray(F)&&Array.isArray($)){if(F.length!==$.length)return!1;for(let D=0;D<F.length;D++)if(!Dd(F[D],$[D]))return!1;return!0}if(g7(F)&&g7($)){let D=Object.keys(F),G=Object.keys($);if(D.length!==G.length)return!1;for(let E of D){if(!Object.prototype.hasOwnProperty.call($,E))return!1;if(!Dd(F[E],$[E]))return!1}return!0}return!1}function g7(F){return Boolean(F&&typeof F==="object"&&!Array.isArray(F))}async function rd8(F,$){if(!ad8(F))return null;try{let D=await import(F),G=D.default||D;if(typeof G!=="object"||G===null||Array.isArray(G))return null;try{return Wd0($,G)}catch{return null}}catch{return null}}async function nd8({name:F="",cwd:$,defaultConfig:D}){let G=$||pD0.cwd(),E=[".ts",".js",".mjs",".cjs",".json"],X=[`${F}.config`,`.${F}.config`,F,`.${F}`];for(let Y of X)for(let U of E){let Z=lD0(G,`${Y}${U}`),W=await rd8(Z,D);if(W!==null)return W}return console.error("Failed to load client config from any expected location"),D}function sd8(F,$={}){let D=$d.cwd();while(D.includes("storage"))D=$d0(D,"..");let G=$d0(D,F||"");if($?.relative)return dd8($d.cwd(),G);return G}async function od8(){try{let F=await nd8({name:"clarity",defaultConfig:vD0,cwd:$d.cwd(),endpoint:"",headers:{}});return{...vD0,...F}}catch{return vD0}}function FA(){if(VH.env.NODE_ENV==="test"||VH.env.BUN_ENV==="test")return!1;return typeof window!=="undefined"}async function Xa8(){if(VH.env.NODE_ENV==="test"||VH.env.BUN_ENV==="test")return!0;if(typeof navigator!=="undefined"&&navigator.product==="ReactNative")return!0;if(typeof VH!=="undefined"){let F=VH.type;if(F==="renderer"||F==="worker")return!1;return!!(VH.versions&&(VH.versions.node||VH.versions.bun))}return!1}class Zd0{async format(F){let $=await Xa8(),D=await this.getMetadata($);return JSON.stringify({timestamp:F.timestamp.toISOString(),level:F.level,name:F.name,message:F.message,metadata:D})}async getMetadata(F){if(F){let{hostname:$}=await import("node:os");return{pid:GS.pid,hostname:$(),environment:GS.env.NODE_ENV||"development",platform:GS.platform,version:GS.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:GS.env.NODE_ENV||GS.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}class Gd{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(F,$={}){this.name=F,this.config={...gD0},this.options=this.normalizeOptions($),this.formatter=this.options.formatter||new Zd0,this.enabled=$.enabled??!0,this.fingersCrossedConfig=this.initializeFingersCrossedConfig($);let D={...$},G=$.timestamp!==void 0;if(G)delete D.timestamp;if(this.config={...this.config,...D,timestamp:G||this.config.timestamp},!this.config.logDirectory)this.config.logDirectory=gD0.logDirectory;if(!FA())uD0(this.config.logDirectory,{recursive:!0,mode:493}).catch((E)=>console.error("Failed to create log directory:",E));if(this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let E=this.generateKeyId(),X=this.generateKey();this.currentKeyId=E,this.keys.set(E,X),this.encryptionKeys.set(E,{key:X,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(F){if(!F.fingersCrossedEnabled&&F.fingersCrossed)return{...iD0,...F.fingersCrossed};if(!F.fingersCrossedEnabled)return null;if(!F.fingersCrossed)return{...iD0};return{...iD0,...F.fingersCrossed}}normalizeOptions(F){let $={format:"json",level:"info",logDirectory:gD0.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,formatter:void 0},D={...$,...Object.fromEntries(Object.entries(F).filter(([,G])=>G!==void 0))};if(!D.level||!["debug","info","success","warning","error"].includes(D.level))D.level=$.level;return D}async writeToFile(F){let D=(async()=>{let E;try{try{try{await Ga8(this.config.logDirectory,Xd0.F_OK|Xd0.W_OK)}catch{await uD0(this.config.logDirectory,{recursive:!0,mode:493})}}catch(Y){throw console.error("Debug: [writeToFile] Failed to create log directory:",Y),Y}let X=this.validateEncryptionConfig()?(await this.encrypt(F)).encrypted:dR.from(F);try{if(!Ux(this.currentLogFile))await Fd(this.currentLogFile,"",{mode:420});if(E=Ed0(this.currentLogFile,"a",420),Da8(E,X,{flag:"a"}),Gd0(E),E!==void 0)_D0(E),E=void 0;if((await Yx(this.currentLogFile)).size===0){if(await Fd(this.currentLogFile,X,{flag:"w",mode:420}),(await Yx(this.currentLogFile)).size===0)throw new Error("File exists but is empty after retry write")}}catch(Y){throw console.error("Debug: [writeToFile] Error writing to file:",Y),Y}finally{if(E!==void 0)try{_D0(E)}catch(Y){console.error("Debug: [writeToFile] Error closing file descriptor:",Y)}}}catch(X){throw console.error("Debug: [writeToFile] Error in writeToFile:",X),X}})();this.pendingOperations.push(D);let G=this.pendingOperations.length-1;try{await D}catch(E){throw console.error("Debug: [writeToFile] Error in operation:",E),E}finally{this.pendingOperations.splice(G,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return Wx(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return Wx(this.config.logDirectory,`${this.name}.log`);let F=new Date().toISOString().split("T")[0];return Wx(this.config.logDirectory,`${this.name}-${F}.log`)}setupRotation(){if(FA())return;if(typeof this.config.rotation==="boolean")return;let F=this.config.rotation,$;switch(F.frequency){case"daily":$=86400000;break;case"weekly":$=604800000;break;case"monthly":$=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},$)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let $=this.config.rotation.keyRotation;if(!$?.enabled)return;let D=typeof $.interval==="number"?$.interval:60,G=Math.max(D,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((E)=>{console.error("Error rotating keys:",E)})},G)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let $=this.config.rotation.keyRotation,D=this.generateKeyId(),G=this.generateKey();this.currentKeyId=D,this.keys.set(D,G),this.encryptionKeys.set(D,{key:G,createdAt:new Date});let E=Array.from(this.encryptionKeys.entries()).sort(([,U],[,Z])=>Z.createdAt.getTime()-U.createdAt.getTime()),X=typeof $.maxKeys==="number"?$.maxKeys:1,Y=Math.max(1,X);if(E.length>Y)for(let[U]of E.slice(Y))this.encryptionKeys.delete(U),this.keys.delete(U)}generateKeyId(){return yD0(16).toString("hex")}generateKey(){return yD0(32)}getCurrentKey(){if(!this.currentKeyId)throw new Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let F=this.keys.get(this.currentKeyId);if(!F)throw new Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:F,id:this.currentKeyId}}encrypt(F){let{key:$}=this.getCurrentKey(),D=yD0(16),G=ed8("aes-256-gcm",$,D),E=dR.concat([G.update(F,"utf8"),G.final()]),X=G.getAuthTag();return{encrypted:dR.concat([D,E,X]),iv:D}}async compressData(F){return new Promise(($,D)=>{let G=Yd0(),E=[];G.on("data",(X)=>E.push(X)),G.on("end",()=>$(dR.from(dR.concat(E)))),G.on("error",D),G.write(F),G.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let F={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let $=this.config.rotation.encrypt;return{...F,...$}}return F}async rotateLog(){if(FA())return;let F=await Yx(this.currentLogFile).catch(()=>null);if(!F)return;let $=this.config.rotation;if(typeof $==="boolean")return;if($.maxSize&&F.size>=$.maxSize){let D=this.currentLogFile,G=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let E=await cD0(this.config.logDirectory),X=E.filter((Z)=>Z.startsWith(this.name)&&/\.log\.\d+$/.test(Z)).sort((Z,W)=>{let K=Number.parseInt(Z.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(W.match(/\.log\.(\d+)$/)?.[1]||"0")-K}),Y=X.length>0?Number.parseInt(X[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,U=`${D}.${Y}`;if(await Yx(D).catch(()=>null))try{if(await Ud0(D,U),$.compress)try{let Z=`${U}.gz`;await this.compressLogFile(U,Z),await mD0(U)}catch(Z){console.error("Error compressing rotated file:",Z)}if(X.length===0&&!E.some((Z)=>Z.endsWith(".log.1")))try{let Z=`${D}.1`;await Fd(Z,"")}catch(Z){console.error("Error creating backup file:",Z)}}catch(Z){console.error(`Error during rotation: ${Z instanceof Error?Z.message:String(Z)}`)}}else{let E=new Date().toISOString().replace(/[:.]/g,"-"),X=D.replace(/\.log$/,`-${E}.log`);if(await Yx(D).catch(()=>null))await Ud0(D,X)}if(this.currentLogFile=G,$.maxFiles){let X=(await cD0(this.config.logDirectory)).filter((Y)=>Y.startsWith(this.name)).sort((Y,U)=>U.localeCompare(Y));for(let Y of X.slice($.maxFiles))await mD0(Wx(this.config.logDirectory,Y))}}}async compressLogFile(F,$){let D=Dd0(F),G=$a8($),E=Yd0();await Ea8(D,E,G)}async handleFingersCrossedBuffer(F,$){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(F)&&!this.isActivated){this.isActivated=!0;for(let D of this.logBuffer){let G=await this.formatter.format(D);await this.writeToFile(G),console.log(G)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile($),console.log($);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let D={timestamp:new Date,level:F,message:$,name:this.name};this.logBuffer.push(D)}}shouldActivateFingersCrossed(F){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(F)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(F){return{debug:0,info:1,success:2,warning:3,error:4}[F]}shouldLog(F){if(!this.enabled)return!1;let $={debug:0,info:1,success:2,warning:3,error:4};return $[F]>=$[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((F)=>{if(F instanceof Promise)return F.catch(($)=>{console.error("Error in pending write operation:",$)});return Promise.resolve()})),Ux(this.currentLogFile))try{let F=Ed0(this.currentLogFile,"r+");Gd0(F),_D0(F)}catch(F){console.error(`Error flushing file: ${F}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let F of this.pendingOperations)if(typeof F.cancel==="function")F.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(F){console.error("Error waiting for pending operations:",F)}if(!FA()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let $=(await cD0(this.config.logDirectory)).filter((D)=>(D.includes("temp")||D.includes(".tmp"))&&D.includes(this.name));for(let D of $)try{await mD0(Wx(this.config.logDirectory,D))}catch(G){console.error(`Failed to delete temp file ${D}:`,G)}}catch(F){console.error("Error cleaning up temporary files:",F)}})()}getCurrentLogFilePath(){return this.currentLogFile}async log(F,$,...D){if(!this.shouldLog(F))return;let E=new Date().toISOString(),X=$;if(D&&D.length>0){let Z=/%([sdijfo%])/g,W=0;if(X=$.replace(Z,(K,J)=>{if(J==="%")return"%";if(W>=D.length)return K;let V=D[W++];switch(J){case"s":return String(V);case"d":case"i":return Number(V).toString();case"j":case"o":return JSON.stringify(V,null,2);default:return K}}),W<D.length)X+=` ${D.slice(W).map((K)=>typeof K==="object"?JSON.stringify(K,null,2):String(K)).join(" ")}`}let Y=`[${E}] local.${F.toUpperCase()}: ${X}
`;if(!Ux(this.config.logDirectory))await uD0(this.config.logDirectory,{recursive:!0,mode:493});if(!Ux(this.currentLogFile))await Fd(this.currentLogFile,"",{mode:420});await this.writeToFile(Y)}time(F){let $=performance.now();return async(D)=>{let G=performance.now(),E=Math.round(G-$);if(D)await this.info(`${F} completed in ${E}ms`,D);else await this.info(`${F} completed in ${E}ms`)}}async debug(F,...$){await this.log("debug",F,...$)}async info(F,...$){await this.log("info",F,...$)}async success(F,...$){await this.log("success",F,...$)}async warn(F,...$){await this.log("warning",F,...$)}async error(F,...$){await this.log("error",F,...$)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let F=this.config.rotation,{encrypt:$}=F;return!!$}async only(F){if(!this.enabled)return;return await F()}isEnabled(){return this.enabled}setEnabled(F){this.enabled=F}extend(F){let $=`${this.name}:${F}`,D=new Gd($,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(D),D}createReadStream(){if(FA())throw new Error("createReadStream is not supported in browser environments");if(!Ux(this.currentLogFile))throw new Error(`Log file does not exist: ${this.currentLogFile}`);return Dd0(this.currentLogFile,{encoding:"utf8"})}async decrypt(F){if(!this.validateEncryptionConfig())throw new Error("Encryption is not configured");let $=this.config.rotation;if(!$.encrypt||typeof $.encrypt==="boolean")throw new Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw new Error("No valid encryption key available");let D=this.keys.get(this.currentKeyId);try{let G=dR.isBuffer(F)?F:dR.from(F,"base64"),E=G.slice(0,16),X=G.slice(-16),Y=G.slice(16,-16),U=Fa8("aes-256-gcm",D,E);return U.setAuthTag(X),dR.concat([U.update(Y),U.final()]).toString("utf8")}catch(G){throw new Error(`Decryption failed: ${G instanceof Error?G.message:String(G)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return FA()}isServerMode(){return!FA()}setTestEncryptionKey(F,$){this.currentKeyId=F,this.keys.set(F,$)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}}var Zj3,Vj3,td8,vD0,gD0,iD0;var Vd0=f(async()=>{Zj3=lD0(pD0.cwd(),"config"),Vj3=lD0(pD0.cwd(),"src/generated");td8=$d.env.CLARITY_LOG_DIR||pd8(sd8(),"storage/logs"),vD0={level:"info",defaultName:"app",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:td8,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};gD0=await od8();iD0={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1}});var Kd0=()=>{};var zd0=()=>{};var Jd0=()=>{};var Hd0=()=>{};var Qd0=()=>{};var Ua8,Pj3;var Rd0=f(()=>{Ua8=new Set([".","!","?"]),Pj3=new Set([...Ua8,":",'"',"'","\u201D"])});function Va8(F){let $=F.trim();$=$.replace(Ya8,Cd0).replace(Wa8,Cd0),$=$.replace(Za8,"\x00");let D=0,G=$.length;while($.charAt(D)==="\x00")D++;if(D===G)return[];while($.charAt(G-1)==="\x00")G--;return $.slice(D,G).split(/\0/g)}function dD0(F,$){let[D,G,E]=Id0(F,$);return D+G.map(Ld0($?.locale)).join($?.delimiter??" ")+E}function ES(F,$){let[D,G,E]=Id0(F,$),X=Ld0($?.locale),Y=Ka8($?.locale),U=$?.mergeAmbiguousCharacters?za8(X,Y):Ja8(X,Y);return D+G.map(U).join($?.delimiter??"")+E}function Ed(F,$){return dD0(F,{delimiter:"-",...$})}function yK(F,$){return dD0(F,{delimiter:"_",...$})}function Ld0(F){return F===!1?($)=>$.toLowerCase():($)=>$.toLocaleLowerCase(F)}function Ka8(F){return F===!1?($)=>$.toUpperCase():($)=>$.toLocaleUpperCase(F)}function za8(F,$){return(D)=>`${$(D[0])}${F(D.slice(1))}`}function Ja8(F,$){return(D,G)=>{let E=D[0];return(G>0&&E>="0"&&E<="9"?`_${E}`:$(E))+F(D.slice(1))}}function Id0(F,$={}){let D=$.split??Va8,G=$.prefixCharacters??Od0,E=$.suffixCharacters??Od0,X=0,Y=F.length;while(X<F.length){let U=F.charAt(X);if(!G.includes(U))break;X++}while(Y>X){let U=Y-1,Z=F.charAt(U);if(!E.includes(Z))break;Y=U}return[F.slice(0,X),D(F.slice(X,Y)),F.slice(Y)]}var Ya8,Wa8,Za8,Cd0="$1\x00$2",Od0="";var aD0=f(()=>{Rd0();Ya8=/([\p{Ll}\d])(\p{Lu})/gu,Wa8=/(\p{Lu})(\p{Lu}\p{Ll})/gu,Za8=/[^\p{L}\d]+/giu});function Nd0(F){return typeof F==="string"?new RegExp(`^${F}$`,"i"):F}function Xd(F,$){if(F===$)return $;if(F===F.toLowerCase())return $.toLowerCase();if(F===F.toUpperCase())return $.toUpperCase();if(F[0]===F[0].toUpperCase())return $.charAt(0).toUpperCase()+$.slice(1).toLowerCase();return $.toLowerCase()}function Qa8(F,...$){return F.replace(/\$(\d{1,2})/g,(D,G)=>$[Number(G)]||"")}function Ra8(F,$){return F.replace($[0],(...D)=>{let G=Qa8($[1],...D);if(D[0]==="")return Xd(F[D[D.length-2]-1],G);return Xd(D[0],G)})}function Bd0(F,$,D){if(!F.length||Ad0[F])return $;for(let G=D.length-1;G>=0;G--){let E=D[G];if(E[0].test($))return Ra8($,E)}return $}function wd0(F,$,D){return(G)=>{let E=G.toLowerCase();if($[E])return Xd(G,E);if(F[E])return Xd(G,F[E]);return Bd0(E,G,D)}}function Td0(F,$,D){return(G)=>{let E=G.toLowerCase();if($[E])return!0;if(F[E])return!1;return Bd0(E,E,D)===E}}var rD0,nD0,Ad0,Zx,Vx,YE=(F,$={})=>{let{count:D=2,inclusive:G=!1}=$;if(typeof F!=="string")throw new TypeError("Word must be a string");let E=D===1?YE.singular(F):YE.plural(F);return G?`${D} ${E}`:E};var sD0=f(()=>{rD0=[],nD0=[],Ad0={},Zx={},Vx={};YE.plural=wd0(Vx,Zx,rD0);YE.isPlural=Td0(Vx,Zx,rD0);YE.singular=wd0(Zx,Vx,nD0);YE.isSingular=Td0(Zx,Vx,nD0);YE.addPluralRule=(F,$)=>{rD0.push([Nd0(F),$])};YE.addSingularRule=(F,$)=>{nD0.push([Nd0(F),$])};YE.addUncountableRule=(F)=>{if(typeof F==="string"){Ad0[F.toLowerCase()]=!0;return}YE.addPluralRule(F,"$0"),YE.addSingularRule(F,"$0")};YE.addIrregularRule=(F,$)=>{let D=$.toLowerCase(),G=F.toLowerCase();Vx[G]=D,Zx[D]=G};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(([F,$])=>YE.addIrregularRule(F,$));[[/s?$/i,"s"],[/[^\x20-\x7F]$/,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(([F,$])=>YE.addPluralRule(F,$));[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|\W|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(([F,$])=>YE.addSingularRule(F,$));["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(YE.addUncountableRule)});var xj3,vj3;var tD0=f(()=>{xj3=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C\'","\u053F":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R\'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}'),vj3=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}')});var Sd0=()=>{};var oD0=f(()=>{tD0();Sd0()});var qd0=f(()=>{aD0();sD0();oD0()});var FG0=f(()=>{aD0();qd0();sD0();tD0();oD0()});var GX=f(()=>{FG0();FG0()});var jd0=f(()=>{GX()});var aR=f(()=>{Kd0();zd0();Jd0();Hd0();Qd0();jd0()});function $G0(F){if(F===null||typeof F!=="object")return!1;let $=Object.getPrototypeOf(F);if($!==null&&$!==Object.prototype&&Object.getPrototypeOf($)!==null)return!1;if(Symbol.iterator in F)return!1;if(Symbol.toStringTag in F)return Object.prototype.toString.call(F)==="[object Module]";return!0}function XG0(F,$,D=".",G){if(!$G0($))return XG0(F,{},D,G);let E=Object.assign({},$);for(let X in F){if(X==="__proto__"||X==="constructor")continue;let Y=F[X];if(Y===null||Y===void 0)continue;if(G&&G(E,X,Y,D))continue;if(Array.isArray(Y)&&Array.isArray(E[X]))E[X]=[...Y,...E[X]];else if($G0(Y)&&$G0(E[X]))E[X]=XG0(Y,E[X],(D?`${D}.`:"")+X.toString(),G);else E[X]=Y}return E}function Na8(F){return(...$)=>$.reduce((D,G)=>XG0(D,G,"",F),{})}function wa8(F){return Object.prototype.toString.call(F)==="[object Object]"}function Ta8(F){if(!wa8(F))return!1;if(!F.message&&!F.args)return!1;if(F.stack)return!1;return!0}class xD{options;_lastLog;_mockFn;constructor(F={}){let $=F.types||EG0;this.options=Ba8({...F,defaults:{...F.defaults},level:GG0(F.level,$),reporters:[...F.reporters||[]]},{types:EG0,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let D in $){let G={type:D,...this.options.defaults,...$[D]};this[D]=this._wrapLogFn(G),this[D].raw=this._wrapLogFn(G,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(F){this.options.level=GG0(F,this.options.types,this.options.level)}prompt(F,$){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(F,$)}create(F){let $=new xD({...this.options,...F});if(this._mockFn)$.mockTypes(this._mockFn);return $}withDefaults(F){return this.create({...this.options,defaults:{...this.options.defaults,...F}})}withTag(F){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+F:F})}addReporter(F){return this.options.reporters.push(F),this}removeReporter(F){if(F){let $=this.options.reporters.indexOf(F);if($!==-1)return this.options.reporters.splice($,1)}else this.options.reporters.splice(0);return this}setReporters(F){return this.options.reporters=Array.isArray(F)?F:[F],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let F in this.options.types){if(!console["__"+F])console["__"+F]=console[F];console[F]=this[F].raw}}restoreConsole(){for(let F in this.options.types)if(console["__"+F])console[F]=console["__"+F],delete console["__"+F]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(F,$){if(!F)return;if(!F.__write)F.__write=F.write;F.write=(D)=>{this[$].raw(String(D).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(F){if(!F)return;if(F.__write)F.write=F.__write,delete F.__write}pauseLogs(){DG0=!0}resumeLogs(){DG0=!1;let F=fd0.splice(0);for(let $ of F)$[0]._logFn($[1],$[2])}mockTypes(F){let $=F||this.options.mockFn;if(this._mockFn=$,typeof $!=="function")return;for(let D in this.options.types)this[D]=$(D,this.options.types[D])||this[D],this[D].raw=this[D]}_wrapLogFn(F,$){return(...D)=>{if(DG0){fd0.push([this,F,D,$]);return}return this._logFn(F,D,$)}}_logFn(F,$,D){if((F.level||0)>this.level)return!1;let G={date:new Date,args:[],...F,level:GG0(F.level,this.options.types)};if(!D&&$.length===1&&Ta8($[0]))Object.assign(G,$[0]);else G.args=[...$];if(G.message)G.args.unshift(G.message),delete G.message;if(G.additional){if(!Array.isArray(G.additional))G.additional=G.additional.split(`
`);G.args.push(`
`+G.additional.join(`
`)),delete G.additional}G.type=typeof G.type==="string"?G.type.toLowerCase():"log",G.tag=typeof G.tag==="string"?G.tag:"";let E=(Y=!1)=>{let U=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&U>0){let Z=[...this._lastLog.object.args];if(U>1)Z.push(`(repeated ${U} times)`);this._log({...this._lastLog.object,args:Z}),this._lastLog.count=1}if(Y)this._lastLog.object=G,this._log(G)};clearTimeout(this._lastLog.timeout);let X=this._lastLog.time&&G.date?G.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=G.date,X<this.options.throttle)try{let Y=JSON.stringify([G.type,G.tag,G.args]),U=this._lastLog.serialized===Y;if(this._lastLog.serialized=Y,U){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(E,this.options.throttle);return}}}catch{}E(!0)}_log(F){for(let $ of this.options.reporters)$.log(F,{options:this.options})}}function GG0(F,$={},D=3){if(F===void 0)return D;if(typeof F==="number")return F;if($[F]&&$[F].level!==void 0)return $[F].level;return D}function hd0(F={}){return new xD(F)}var TG,EG0,Ba8,DG0=!1,fd0;var UG0=f(()=>{TG={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},EG0={silent:{level:-1},fatal:{level:TG.fatal},error:{level:TG.error},warn:{level:TG.warn},log:{level:TG.log},info:{level:TG.info},success:{level:TG.success},fail:{level:TG.fail},ready:{level:TG.info},start:{level:TG.info},box:{level:TG.info},debug:{level:TG.debug},trace:{level:TG.trace},verbose:{level:TG.verbose}};Ba8=Na8();fd0=[];xD.prototype.add=xD.prototype.addReporter;xD.prototype.remove=xD.prototype.removeReporter;xD.prototype.clear=xD.prototype.removeReporter;xD.prototype.withScope=xD.prototype.withTag;xD.prototype.mock=xD.prototype.mockTypes;xD.prototype.pause=xD.prototype.pauseLogs;xD.prototype.resume=xD.prototype.resumeLogs});import{formatWithOptions as Md0}from"node:util";import{sep as Sa8}from"node:path";function WG0(F,$){let D=process.cwd()+Sa8;return F.split(`
`).splice($.split(`
`).length).map((E)=>E.trim().replace("file://","").replace(D,""))}function qa8(F,$){return($.__write||$.write).call($,F)}class Ud{formatStack(F,$,D){let G=" ".repeat((D?.errorLevel||0)+1);return G+WG0(F,$).join(`
${G}`)}formatError(F,$){let D=F.message??Md0($,F),G=F.stack?this.formatStack(F.stack,D,$):"",E=$?.errorLevel||0,X=E>0?`${" ".repeat(E)}[cause]: `:"",Y=F.cause?`
`+this.formatError(F.cause,{...$,errorLevel:E+1}):"";return X+D+`
`+G+Y}formatArgs(F,$){let D=F.map((G)=>{if(G&&typeof G.stack==="string")return this.formatError(G,$);return G});return Md0($,...D)}formatDate(F,$){return $.date?F.toLocaleTimeString():""}filterAndJoin(F){return F.filter(Boolean).join(" ")}formatLogObj(F,$){let D=this.formatArgs(F.args,$);if(F.type==="box")return`
`+[YG0(F.tag),F.title&&F.title,...D.split(`
`)].filter(Boolean).map((G)=>" > "+G).join(`
`)+`
`;return this.filterAndJoin([YG0(F.type),YG0(F.tag),D])}log(F,$){let D=this.formatLogObj(F,{columns:$.options.stdout.columns||0,...$.options.formatOptions});return qa8(D+`
`,F.level<2?$.options.stderr||process.stderr:$.options.stdout||process.stdout)}}var YG0=(F)=>F?`[${F}]`:"";var bd0=()=>{};import*as Yd from"node:tty";function yd0(F,$,D,G,E=$.slice(0,Math.max(0,F))+G,X=$.slice(Math.max(0,F+D.length)),Y=X.indexOf(D)){return E+(Y<0?X:yd0(Y,X,D,G))}function xa8(F,$,D,G,E){return F<0?D+$+G:D+yd0(F,$,G,E)+G}function va8(F,$,D=F,G=F.length+1){return(E)=>E||!(E===""||E===void 0)?xa8((""+E).indexOf($,G),E,F,$,D):""}function s4(F,$,D){return va8(`\x1B[${F}m`,`\x1B[${$}m`,D)}function ga8(F=ka8){return F?kd0:Object.fromEntries(Object.keys(kd0).map(($)=>[$,String]))}function ZG0(F,$="reset"){return SG[F]||SG[$]}function GW(F){return F.replace(new RegExp(ya8,"g"),"")}function Wd(F,$={}){let D={...$,style:{..._a8,...$.style}},G=F.split(`
`),E=[],X=ZG0(D.style.borderColor),Y={...typeof D.style.borderStyle==="string"?xd0[D.style.borderStyle]||xd0.solid:D.style.borderStyle};if(X)for(let z in Y)Y[z]=X(Y[z]);let U=D.style.padding%2===0?D.style.padding:D.style.padding+1,Z=G.length+U,W=Math.max(...G.map((z)=>GW(z).length),D.title?GW(D.title).length:0)+U,K=W+U,J=D.style.marginLeft>0?" ".repeat(D.style.marginLeft):"";if(D.style.marginTop>0)E.push("".repeat(D.style.marginTop));if(D.title){let z=X?X(D.title):D.title,C=Y.h.repeat(Math.floor((W-GW(D.title).length)/2)),H=Y.h.repeat(W-GW(D.title).length-GW(C).length+U);E.push(`${J}${Y.tl}${C}${z}${H}${Y.tr}`)}else E.push(`${J}${Y.tl}${Y.h.repeat(K)}${Y.tr}`);let V=D.style.valign==="center"?Math.floor((Z-G.length)/2):D.style.valign==="top"?Z-G.length-U:Z-G.length;for(let z=0;z<Z;z++)if(z<V||z>=V+G.length)E.push(`${J}${Y.v}${" ".repeat(K)}${Y.v}`);else{let C=G[z-V],H=" ".repeat(U),Q=" ".repeat(W-GW(C).length);E.push(`${J}${Y.v}${H}${C}${Q}${Y.v}`)}if(E.push(`${J}${Y.bl}${Y.h.repeat(K)}${Y.br}`),D.style.marginBottom>0)E.push("".repeat(D.style.marginBottom));return E.join(`
`)}var rR,vd0,Pa8,ja8,fa8,ha8,gd0,Ma8,ba8,ka8,kd0,SG,ya8,xd0,_a8;var Zd=f(()=>{({env:rR={},argv:vd0=[],platform:Pa8=""}=typeof process==="undefined"?{}:process),ja8="NO_COLOR"in rR||vd0.includes("--no-color"),fa8="FORCE_COLOR"in rR||vd0.includes("--color"),ha8=Pa8==="win32",gd0=rR.TERM==="dumb",Ma8=Yd&&Yd.isatty&&Yd.isatty(1)&&rR.TERM&&!gd0,ba8="CI"in rR&&(("GITHUB_ACTIONS"in rR)||("GITLAB_CI"in rR)||("CIRCLECI"in rR)),ka8=!ja8&&(fa8||ha8&&!gd0||Ma8||ba8);kd0={reset:s4(0,0),bold:s4(1,22,"\x1B[22m\x1B[1m"),dim:s4(2,22,"\x1B[22m\x1B[2m"),italic:s4(3,23),underline:s4(4,24),inverse:s4(7,27),hidden:s4(8,28),strikethrough:s4(9,29),black:s4(30,39),red:s4(31,39),green:s4(32,39),yellow:s4(33,39),blue:s4(34,39),magenta:s4(35,39),cyan:s4(36,39),white:s4(37,39),gray:s4(90,39),bgBlack:s4(40,49),bgRed:s4(41,49),bgGreen:s4(42,49),bgYellow:s4(43,49),bgBlue:s4(44,49),bgMagenta:s4(45,49),bgCyan:s4(46,49),bgWhite:s4(47,49),blackBright:s4(90,39),redBright:s4(91,39),greenBright:s4(92,39),yellowBright:s4(93,39),blueBright:s4(94,39),magentaBright:s4(95,39),cyanBright:s4(96,39),whiteBright:s4(97,39),bgBlackBright:s4(100,49),bgRedBright:s4(101,49),bgGreenBright:s4(102,49),bgYellowBright:s4(103,49),bgBlueBright:s4(104,49),bgMagentaBright:s4(105,49),bgCyanBright:s4(106,49),bgWhiteBright:s4(107,49)};SG=ga8();ya8=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");xd0={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},_a8={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1}});var Za0={};o$(Za0,{prompt:()=>Wa0,kCancel:()=>Ya0});import pZ,{stdin as ua8,stdout as ca8}from"node:process";import _d0 from"node:readline";import{WriteStream as ma8}from"node:tty";function ia8(F){return F&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F}function la8(){if(ud0)return VG0;ud0=1;let F="\x1B",$=`${F}[`,D="\x07",G={to(Y,U){if(!U)return`${$}${Y+1}G`;return`${$}${U+1};${Y+1}H`},move(Y,U){let Z="";if(Y<0)Z+=`${$}${-Y}D`;else if(Y>0)Z+=`${$}${Y}C`;if(U<0)Z+=`${$}${-U}A`;else if(U>0)Z+=`${$}${U}B`;return Z},up:(Y=1)=>`${$}${Y}A`,down:(Y=1)=>`${$}${Y}B`,forward:(Y=1)=>`${$}${Y}C`,backward:(Y=1)=>`${$}${Y}D`,nextLine:(Y=1)=>`${$}E`.repeat(Y),prevLine:(Y=1)=>`${$}F`.repeat(Y),left:`${$}G`,hide:`${$}?25l`,show:`${$}?25h`,save:`${F}7`,restore:`${F}8`},E={up:(Y=1)=>`${$}S`.repeat(Y),down:(Y=1)=>`${$}T`.repeat(Y)},X={screen:`${$}2J`,up:(Y=1)=>`${$}1J`.repeat(Y),down:(Y=1)=>`${$}J`.repeat(Y),line:`${$}2K`,lineEnd:`${$}K`,lineStart:`${$}1K`,lines(Y){let U="";for(let Z=0;Z<Y;Z++)U+=this.line+(Z<Y-1?G.up():"");if(Y)U+=G.left;return U}};return VG0={cursor:G,scroll:E,erase:X,beep:D},VG0}function pa8(){if(cd0)return Vd.exports;cd0=1;let F=process||{},$=F.argv||[],D=F.env||{},G=!(!!D.NO_COLOR||$.includes("--no-color"))&&(!!D.FORCE_COLOR||$.includes("--color")||F.platform==="win32"||(F.stdout||{}).isTTY&&D.TERM!=="dumb"||!!D.CI),E=(U,Z,W=U)=>(K)=>{let J=""+K,V=J.indexOf(Z,U.length);return~V?U+X(J,Z,W,V)+Z:U+J+Z},X=(U,Z,W,K)=>{let J="",V=0;do J+=U.substring(V,K)+W,V=K+Z.length,K=U.indexOf(Z,V);while(~K);return J+U.substring(V)},Y=(U=G)=>{let Z=U?E:()=>String;return{isColorSupported:U,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),w