@visulima/packem 2.0.0-alpha.81 → 2.0.0-alpha.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## @visulima/packem [2.0.0-alpha.82](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.81...@visulima/packem@2.0.0-alpha.82) (2026-06-02)
2
+
3
+ ### Features
4
+
5
+ * **babel:** add parallel worker-pool transforms ([#204](https://github.com/visulima/packem/issues/204)) ([7a5444c](https://github.com/visulima/packem/commit/7a5444c4a17c464b4809323374b1244701425f4b))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/rollup-plugin-css:** upgraded to 1.0.0-alpha.49
11
+ * **@visulima/rollup-plugin-dts:** upgraded to 1.0.0-alpha.30
12
+ * **@visulima/packem-rollup:** upgraded to 1.0.0-alpha.69
13
+
1
14
  ## @visulima/packem [2.0.0-alpha.81](https://github.com/visulima/packem/compare/@visulima/packem@2.0.0-alpha.80...@visulima/packem@2.0.0-alpha.81) (2026-06-02)
2
15
 
3
16
  ### Features
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var u=(r,e)=>g(r,"name",{value:e,configurable:!0});import{transformAsync as d}from"@babel/core";var f=Object.defineProperty,l=u((r,e)=>f(r,"name",{value:e,configurable:!0}),"a");const y=/\.tsx?$/,A=/['"]use memo['"]/,h=l(r=>r.find(e=>e==="babel-plugin-react-compiler"||Array.isArray(e)&&e[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),O=l((r,e)=>{if(r.length===0)return;const t=h(r);if(!(!t||!Array.isArray(t))&&t[1]?.compilationMode==="annotation"&&!A.test(e)){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}},"filterReactCompilerByAnnotation"),w=l(async(r,e,{filename:t,generatorOpts:o,sourceFileName:m,...s})=>{let i=[];s.plugins&&Array.isArray(s.plugins)&&(i=[...s.plugins]),i.length>0&&O(i,r);const n=[];(e.endsWith(".jsx")||e.endsWith(".tsx"))&&n.push("jsx"),y.test(e)&&n.push("typescript");const a=s.parserOpts?.plugins;a&&Array.isArray(a)&&n.unshift(...a);const c=[...new Set(n)],p=await d(r,{...s,filename:t??e,generatorOpts:{...o,decoratorsBeforeExport:!0,importAttributesKeyword:"with"},parserOpts:{...s.parserOpts,allowAwaitOutsideFunction:!0,plugins:c.length>0?c:[],sourceType:"module"},plugins:i.length>0?i:[],sourceFileName:m??e});if(p?.code)return{code:p.code,map:p.map??void 0}},"transformCode");export{w as t};
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var e=(r,o)=>t(r,"name",{value:o,configurable:!0});import f from"workerpool";import{t as m}from"../../packem_shared/transform-code-Cd2HSMcx.js";var n=Object.defineProperty,s=e((r,o)=>n(r,"name",{value:o,configurable:!0}),"s");const c=s(async(r,o,a)=>m(r,o,a),"transform");f.worker({transform:c});
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- var ne=Object.defineProperty;var h=(t,e)=>ne(t,"name",{value:e,configurable:!0});import{createCerebro as oe}from"@visulima/cerebro";import ce from"@visulima/cerebro/logger/pail";import{N as z,m as U,B as le,c as de,l as ue,d as pe,T as me,f as fe,A as ge,M as ye,h as we}from"../packem_shared/index-CD5sgWFu.js";import j,{cwd as A,exit as be}from"node:process";import{installPackage as C}from"@antfu/install-pkg";import{confirm as w,select as v,multiselect as J,spinner as I,cancel as F,isCancel as _,intro as H,log as N,outro as Y}from"@clack/prompts";import ve from"magic-string";import{exec as he}from"tinyexec";import{_ as S,L as T}from"../packem_shared/utils-nmTpa3um.js";import{PRODUCTION_ENV as X,DEVELOPMENT_ENV as ke}from"@visulima/packem-share/constants";import{createJiti as $e}from"jiti";import{writeFile as Q,readFile as Se}from"node:fs/promises";import{q as Ce,w as je,i as R,B as Pe}from"../packem_shared/create-or-update-key-storage-DUTe5Prf.js";import{existsSync as q}from"node:fs";import{parseEnv as G}from"node:util";import{createInterface as xe}from"node:readline/promises";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
2
+ var ne=Object.defineProperty;var h=(t,e)=>ne(t,"name",{value:e,configurable:!0});import{createCerebro as oe}from"@visulima/cerebro";import ce from"@visulima/cerebro/logger/pail";import{N as z,m as U,B as le,c as de,l as ue,d as pe,T as me,f as fe,A as ge,M as ye,h as we}from"../packem_shared/index-DFZJP0ed.js";import j,{cwd as A,exit as be}from"node:process";import{installPackage as C}from"@antfu/install-pkg";import{confirm as w,select as v,multiselect as J,spinner as I,cancel as F,isCancel as _,intro as H,log as N,outro as Y}from"@clack/prompts";import ve from"magic-string";import{exec as he}from"tinyexec";import{_ as S,L as T}from"../packem_shared/utils-nmTpa3um.js";import{PRODUCTION_ENV as X,DEVELOPMENT_ENV as ke}from"@visulima/packem-share/constants";import{createJiti as $e}from"jiti";import{writeFile as Q,readFile as Se}from"node:fs/promises";import{q as Ce,w as je,i as R,B as Pe}from"../packem_shared/create-or-update-key-storage-DUTe5Prf.js";import{existsSync as q}from"node:fs";import{parseEnv as G}from"node:util";import{createInterface as xe}from"node:readline/promises";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
3
3
  const require = __cjs_mod__.createRequire(import.meta.url);
4
- var Ee="@visulima/packem",Z="2.0.0-alpha.80";const K={version:Z},ee={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","@csstools/css-parser-algorithms","@csstools/css-tokenizer","@csstools/postcss-slow-plugins","icss-utils","@visulima/css-style-inject"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"],tailwindcss:["@tailwindcss/node","@tailwindcss/oxide","tailwindcss"]};var De=Object.defineProperty,u=h((t,e)=>De(t,"name",{value:e,configurable:!0}),"i");const Me=/defineConfig\s*\(\s*\{/,Le=/preset:\s*['"][^'"]+['"]/,Oe=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Ne=["@babel/core","@babel/preset-react"],Ie=["react","react-dom"],Te=["@babel/core","babel-preset-solid"],Be=["solid-js"],Ve=["@babel/core","@babel/preset-react","babel-plugin-transform-hook-names"],Re=["preact"],Ae=["unplugin-vue"],Fe=["vue"],qe=["rollup-plugin-svelte"],Ge=["svelte"],P=u((t,e,s)=>t.includes(`preset: '${e}'`)||t.includes(`preset: "${e}"`)||t.includes(`preset: '${e}',`)||t.includes(`preset: "${e}",`)||t.includes(s)||t.includes(`@visulima/packem/config/preset/${e}`),"checkPresetExists"),x=u((t,e)=>{const{logger:s,magic:a,packemConfig:r}=t,i=Me.exec(r);if(i?.index!==void 0){const o=i.index+i[0].length;if(r.includes("preset:")){const n=Le.exec(r);if(n)a.replace(n[0],`preset: '${e}'`);else throw s.warn(`A preset already exists in the config. Please manually set it to '${e}'.`),new Error("Preset exists but is not a string")}else a.appendLeft(o,`
4
+ var Ee="@visulima/packem",Z="2.0.0-alpha.81";const K={version:Z},ee={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","@csstools/css-parser-algorithms","@csstools/css-tokenizer","@csstools/postcss-slow-plugins","icss-utils","@visulima/css-style-inject"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"],tailwindcss:["@tailwindcss/node","@tailwindcss/oxide","tailwindcss"]};var De=Object.defineProperty,u=h((t,e)=>De(t,"name",{value:e,configurable:!0}),"i");const Me=/defineConfig\s*\(\s*\{/,Le=/preset:\s*['"][^'"]+['"]/,Oe=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Ne=["@babel/core","@babel/preset-react"],Ie=["react","react-dom"],Te=["@babel/core","babel-preset-solid"],Be=["solid-js"],Ve=["@babel/core","@babel/preset-react","babel-plugin-transform-hook-names"],Re=["preact"],Ae=["unplugin-vue"],Fe=["vue"],qe=["rollup-plugin-svelte"],Ge=["svelte"],P=u((t,e,s)=>t.includes(`preset: '${e}'`)||t.includes(`preset: "${e}"`)||t.includes(`preset: '${e}',`)||t.includes(`preset: "${e}",`)||t.includes(s)||t.includes(`@visulima/packem/config/preset/${e}`),"checkPresetExists"),x=u((t,e)=>{const{logger:s,magic:a,packemConfig:r}=t,i=Me.exec(r);if(i?.index!==void 0){const o=i.index+i[0].length;if(r.includes("preset:")){const n=Le.exec(r);if(n)a.replace(n[0],`preset: '${e}'`);else throw s.warn(`A preset already exists in the config. Please manually set it to '${e}'.`),new Error("Preset exists but is not a string")}else a.appendLeft(o,`
5
5
  preset: '${e}',`)}else if(r.includes("transformer:"))a.replace("transformer:",`preset: '${e}',
6
6
  transformer:`);else{const o=r.indexOf("{");o!==-1&&a.appendLeft(o+1,`
7
7
  preset: '${e}',`)}},"insertPreset"),Ke=u(async t=>{try{return((await he("git",["status","--porcelain"],{nodeOptions:{cwd:t,stdio:["pipe","pipe","pipe"]}})).stdout?.trim().length??0)>0}catch{return!1}},"checkGitDirty"),te=u(async t=>{const e=S(t,"package.json"),s=await z(e,{resolveCatalogs:!0});return!!(s.devDependencies?.typescript??s.dependencies?.typescript)},"checkTypeScriptInstalled"),We=u(async t=>{const e=await te(t),s=[...Ie],a=[...Ne];return e?a.push("@types/react","@types/react-dom"):await w({initialValue:!1,message:"Do you want to use TypeScript?"})&&a.push("typescript","@types/react","@types/react-dom"),{devPackages:a,packages:s}},"getReactTypeDependencies"),E=u(async(t,e,s)=>{const{rootDirectory:a,spinner:r}=t;r.start("Installing packages"),await C(s,{cwd:a,dev:!1,silent:!0}),await C(e,{cwd:a,dev:!0,silent:!0}),r.stop("Installed packages")},"installPackages"),ze=u(async t=>{const{logger:e,magic:s,packemConfig:a,packemConfigFormat:r,rootDirectory:i,spinner:o,transformerReplaceKey:n,transformerSearchKey:c}=t;if(a.includes("typedoc: typedocBuilder")||a.includes("@visulima/packem/builder/typedoc")){e.warn("Typedoc has already been added to the packem config.");return}r==="cjs"?s.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0});import{createRequire as Ke}from"node:module";import{e as Ae,t as Yt,U as Zt,_ as Xt,C as er,j as xe,Z as tr,Q as Qe,v as Me,W as rr,K as sr,$ as Pe,a as At,r as ir,b as nr,h as or,M as ar}from"./packem_shared/index-CD5sgWFu.js";import{g as Mt}from"./packem_shared/create-or-update-key-storage-DUTe5Prf.js";var lr=Object.defineProperty,v=w((t,e)=>lr(t,"name",{value:e,configurable:!0}),"f$1");const cr=Ke(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:re,Ye=v(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,r]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ae.getBuiltinModule(t)}return cr(t)},"__cjs_getBuiltinModule"),re=ae,{execFileSync:ur}=Ye("node:child_process"),ge=Ye("node:fs"),fr=Ye("node:tty"),Ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Xe=[12288,12288,65281,65376,65504,65510],et=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],tt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],me=v((t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},"isInRange"),hr=Ze[0],gr=Ze.at(-1),dr=Xe[0],pr=Xe.at(-1),mr=et[0],br=et.at(-1),yr=tt[0],wr=tt.at(-1),$r=je[0],vr=je.at(-1),dt=19968,[xr,Sr]=Lt(je);function Lt(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(dt>=i&&dt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}w(Lt,"Ft$1");v(Lt,"findWideFastPathRange");const Er=v(t=>t<hr||t>gr?!1:me(Ze,t),"isAmbiguous"),kr=v(t=>t<dr||t>pr?!1:me(Xe,t),"isFullWidth"),Tr=v(t=>t<mr||t>br?!1:me(et,t),"isHalfWidth"),Ar=v(t=>t<yr||t>wr?!1:me(tt,t),"isNarrow"),Mr=v(t=>t>=xr&&t<=Sr?!0:t<$r||t>vr?!1:me(je,t),"isWide");function Bt(t){return Er(t)?"ambiguous":kr(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":Mr(t)?"wide":"neutral"}w(Bt,"Ht$1");v(Bt,"getCategory");function Ot(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}w(Ot,"Dt$1");v(Ot,"validate");function rt(t){return Ot(t),Bt(t)}w(rt,"it");v(rt,"eastAsianWidthType");const jt=String.raw,pt=jt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Lr=v(()=>new RegExp(jt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${pt}(?:\u200D${pt})*`,"gu"),"emojiRegex"),ue=new Set(["\x1B","›"]),Ne="\x07",Nt="[",st="m",Le="]8;;",Br=39,Or=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${Nt}(?<code>\\d+)m|\\${Le}(?<uri>.*)${Ne})`),Nr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),fe=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Se=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Re=Lr(),mt=new Map,Ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=v(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Ir=v((t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=mt.get(r);if(i||(i=new Map,mt.set(r,i)),i.has(s))return i.get(s);let o;if(ke(t)==="latin")o=e.width.regular;else if(ke(t)==="control")o=e.width.control;else if(ke(t)==="wide")o=e.width.wide;else switch(rt(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},"getCachedCharWidth"),Fr=v(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),He=v((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?He(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("›");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="›")){if(t.startsWith("\x1B]8;;",a)){const S="\x1B]8;;\x07",I=S.length,z=t.indexOf("\x07",a+5);if(z!==-1){const J=t.indexOf(S,z+1);if(J!==-1){const d=J+I,g=t.slice(z+1,J).replace(fe,""),x=He(g,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),R=x.width;if(x.truncated)u=!0,c=Math.min(c,a);else if(n+R>s&&(c=Math.min(c,a),u=!0,n+R>r.truncation.limit))break;if(n+=R,a=d,u&&n>=r.truncation.limit)break;continue}}}if(fe.lastIndex=a,fe.test(t)){const S=fe.lastIndex-a,I=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(n+I>s&&(c=Math.min(c,a),n+I>r.truncation.limit)){u=!0;break}n+=I,a=fe.lastIndex;continue}}const $=t.codePointAt(a);if($===8203||$===65279||$>=8288&&$<=8292){a+=1;continue}if($===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(Ee.lastIndex=a,Ee.test(t)){const S=(Ee.lastIndex-a)*r.width.regular;if(n+S>s){const I=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+I),n+S>r.truncation.limit){u=!0;break}}n+=S,a=Ee.lastIndex;continue}if(($<=31||$>=127&&$<=159)&&(Se.lastIndex=a,Se.test(t))){const S=(Se.lastIndex-a)*r.width.control;if(n+S>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+S>r.truncation.limit)){u=!0;break}n+=S,a=Se.lastIndex;continue}if(Re.lastIndex=a,Re.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=Re.lastIndex;continue}const P=t.codePointAt(a)??0;if(Fr(P)){a+=P>65535?2:1;continue}let E;if(o)E=Ir(P,r);else switch(ke(P)){case"control":{E=r.width.control;break}case"latin":{E=r.width.regular;break}case"wide":{E=r.width.wide;break}case"zero":{E=0;break}default:switch(rt(P)){case"ambiguous":{E=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{E=r.width.fullWidth;break}case"wide":{E=r.width.wide;break}default:E=r.width.regular}}if(n+E>s&&(c=Math.min(c,a),n+E>r.truncation.limit)){u=!0;break}n+=E,a+=P>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},"getStringTruncatedWidth"),se=v((t,e={})=>He(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth"),Pr=/\x1B\[(\d+)m/;class It{static{w(this,"at")}static{v(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Pr.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Ft=v((t,e)=>{if(!ue.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+Le.length).join("")===Le;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),Rr=v((t,e={})=>{const r=new It;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ue.has(l)){if(s){const E=e.getWidth?.(s)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:s,width:E};if(n&&(S.isHyperlink=!0,S.hyperlinkUrl=a),e.onSegment?.(S,r)===!1)return;s=""}i=!0,o=l;const $=Ft(c,u),{isInsideLinkEscape:P}=$;if(P){let E=u+1;for(a="";E<c.length;){const I=c[E];if(I===Ne)break;a+=I,E+=1}a=a.slice(4);const S={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,r)===!1)return;u=E,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const E={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(E,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===st){i=!1,r.processEscape(o);const $={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.($,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},"processAnsiString"),bt=v(t=>`${ue.values().next().value}${Nt}${String(t)}${st}`,"wrapAnsiCode"),yt=v(t=>`${ue.values().next().value}${Le}${t}${Ne}`,"wrapAnsiHyperlink"),_r=v(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
1
+ var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0});import{createRequire as Ke}from"node:module";import{e as Ae,t as Yt,U as Zt,_ as Xt,C as er,j as xe,Z as tr,Q as Qe,v as Me,W as rr,K as sr,$ as Pe,a as At,r as ir,b as nr,h as or,M as ar}from"./packem_shared/index-DFZJP0ed.js";import{g as Mt}from"./packem_shared/create-or-update-key-storage-DUTe5Prf.js";var lr=Object.defineProperty,v=w((t,e)=>lr(t,"name",{value:e,configurable:!0}),"f$1");const cr=Ke(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:re,Ye=v(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,r]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ae.getBuiltinModule(t)}return cr(t)},"__cjs_getBuiltinModule"),re=ae,{execFileSync:ur}=Ye("node:child_process"),ge=Ye("node:fs"),fr=Ye("node:tty"),Ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Xe=[12288,12288,65281,65376,65504,65510],et=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],tt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],me=v((t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},"isInRange"),hr=Ze[0],gr=Ze.at(-1),dr=Xe[0],pr=Xe.at(-1),mr=et[0],br=et.at(-1),yr=tt[0],wr=tt.at(-1),$r=je[0],vr=je.at(-1),dt=19968,[xr,Sr]=Lt(je);function Lt(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(dt>=i&&dt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}w(Lt,"Ft$1");v(Lt,"findWideFastPathRange");const Er=v(t=>t<hr||t>gr?!1:me(Ze,t),"isAmbiguous"),kr=v(t=>t<dr||t>pr?!1:me(Xe,t),"isFullWidth"),Tr=v(t=>t<mr||t>br?!1:me(et,t),"isHalfWidth"),Ar=v(t=>t<yr||t>wr?!1:me(tt,t),"isNarrow"),Mr=v(t=>t>=xr&&t<=Sr?!0:t<$r||t>vr?!1:me(je,t),"isWide");function Bt(t){return Er(t)?"ambiguous":kr(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":Mr(t)?"wide":"neutral"}w(Bt,"Ht$1");v(Bt,"getCategory");function Ot(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}w(Ot,"Dt$1");v(Ot,"validate");function rt(t){return Ot(t),Bt(t)}w(rt,"it");v(rt,"eastAsianWidthType");const jt=String.raw,pt=jt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Lr=v(()=>new RegExp(jt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${pt}(?:\u200D${pt})*`,"gu"),"emojiRegex"),ue=new Set(["\x1B","›"]),Ne="\x07",Nt="[",st="m",Le="]8;;",Br=39,Or=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${Nt}(?<code>\\d+)m|\\${Le}(?<uri>.*)${Ne})`),Nr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),fe=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Se=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Re=Lr(),mt=new Map,Ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=v(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Ir=v((t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=mt.get(r);if(i||(i=new Map,mt.set(r,i)),i.has(s))return i.get(s);let o;if(ke(t)==="latin")o=e.width.regular;else if(ke(t)==="control")o=e.width.control;else if(ke(t)==="wide")o=e.width.wide;else switch(rt(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},"getCachedCharWidth"),Fr=v(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),He=v((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?He(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("›");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="›")){if(t.startsWith("\x1B]8;;",a)){const S="\x1B]8;;\x07",I=S.length,z=t.indexOf("\x07",a+5);if(z!==-1){const J=t.indexOf(S,z+1);if(J!==-1){const d=J+I,g=t.slice(z+1,J).replace(fe,""),x=He(g,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),R=x.width;if(x.truncated)u=!0,c=Math.min(c,a);else if(n+R>s&&(c=Math.min(c,a),u=!0,n+R>r.truncation.limit))break;if(n+=R,a=d,u&&n>=r.truncation.limit)break;continue}}}if(fe.lastIndex=a,fe.test(t)){const S=fe.lastIndex-a,I=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(n+I>s&&(c=Math.min(c,a),n+I>r.truncation.limit)){u=!0;break}n+=I,a=fe.lastIndex;continue}}const $=t.codePointAt(a);if($===8203||$===65279||$>=8288&&$<=8292){a+=1;continue}if($===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(Ee.lastIndex=a,Ee.test(t)){const S=(Ee.lastIndex-a)*r.width.regular;if(n+S>s){const I=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+I),n+S>r.truncation.limit){u=!0;break}}n+=S,a=Ee.lastIndex;continue}if(($<=31||$>=127&&$<=159)&&(Se.lastIndex=a,Se.test(t))){const S=(Se.lastIndex-a)*r.width.control;if(n+S>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+S>r.truncation.limit)){u=!0;break}n+=S,a=Se.lastIndex;continue}if(Re.lastIndex=a,Re.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=Re.lastIndex;continue}const P=t.codePointAt(a)??0;if(Fr(P)){a+=P>65535?2:1;continue}let E;if(o)E=Ir(P,r);else switch(ke(P)){case"control":{E=r.width.control;break}case"latin":{E=r.width.regular;break}case"wide":{E=r.width.wide;break}case"zero":{E=0;break}default:switch(rt(P)){case"ambiguous":{E=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{E=r.width.fullWidth;break}case"wide":{E=r.width.wide;break}default:E=r.width.regular}}if(n+E>s&&(c=Math.min(c,a),n+E>r.truncation.limit)){u=!0;break}n+=E,a+=P>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},"getStringTruncatedWidth"),se=v((t,e={})=>He(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth"),Pr=/\x1B\[(\d+)m/;class It{static{w(this,"at")}static{v(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Pr.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Ft=v((t,e)=>{if(!ue.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+Le.length).join("")===Le;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),Rr=v((t,e={})=>{const r=new It;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ue.has(l)){if(s){const E=e.getWidth?.(s)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:s,width:E};if(n&&(S.isHyperlink=!0,S.hyperlinkUrl=a),e.onSegment?.(S,r)===!1)return;s=""}i=!0,o=l;const $=Ft(c,u),{isInsideLinkEscape:P}=$;if(P){let E=u+1;for(a="";E<c.length;){const I=c[E];if(I===Ne)break;a+=I,E+=1}a=a.slice(4);const S={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,r)===!1)return;u=E,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const E={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(E,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===st){i=!1,r.processEscape(o);const $={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.($,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},"processAnsiString"),bt=v(t=>`${ue.values().next().value}${Nt}${String(t)}${st}`,"wrapAnsiCode"),yt=v(t=>`${ue.values().next().value}${Le}${t}${Ne}`,"wrapAnsiHyperlink"),_r=v(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
2
2
  `),o=[...i];let a=0;for(const[n,c]of o.entries()){if(e+=c,ue.has(c)){const l=jr.exec(i.slice(a))?.groups??{};if(l.code!==void 0){const h=Number.parseFloat(l.code);r=h===Br?void 0:h}else l.uri!==void 0&&(s=l.uri.length===0?void 0:l.uri)}const u=Nr.get(Number(r));o[n+1]===`
3
3
  `?(s&&(e+=yt("")),r&&u&&(e+=bt(u))):c===`
4
4
  `&&(r&&u&&(e+=bt(r)),s&&(e+=yt(s))),a+=c.length}return e},"preserveAnsi"),Pt=/(?=\s)|(?<=\s)/,Rt=/^\s+$/,_e=v(t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},"resetAnsiAtLineBreak"),oe=v(t=>{const e=t.split(" ");let r=e.length;for(;r>0&&se(e[r-1])===0;)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),_t=v((t,e,r)=>{if(t.length===0)return[""];if(e<=0)return[t];const s=[],i=new It;let o="",a=0,n=!1,c=!1,u="",l=0;for(;l<t.length;){const h=t[l];if(ue.has(h)){n=!0,u=h,o+=h,c=Ft([...t],l).isInsideLinkEscape,l+=1;continue}if(n){u+=h,o+=h,c?h===Ne&&(n=c=!1):h===st&&(n=!1,i.processEscape(u)),l+=1;continue}const p=se(h),$=h===" ";if(p===0){o+=h,l+=1;continue}if(a+p>e&&(o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=se(o),$&&r)){for(;l<t.length&&t[l]===" ";)l+=1;continue}if(o+=h,a+=p,a===e&&l<t.length-1&&(s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=se(o),l+1<t.length&&t[l+1]===" "&&r)){for(l+=1;l<t.length&&t[l]===" ";)l+=1;continue}l+=1}return o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),r?s.map(h=>oe(h)):s},"wrapWithBreakAtWidth"),Cr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=[];let o="",a=0;return Rr(s,{getWidth:se,onSegment:v((n,c)=>{const u=n.text??"";if(n.isEscapeSequence)o+=u;else{const l=u===" ";if(n.width===0)return o+=u,!0;if(a+n.width>e&&(o&&i.push(o),o=c.getStartEscapesForAllActiveAttributes(),a=0,l))return r||i.push(c.getStartEscapesForAllActiveAttributes()+u),!0;o+=u,a+=n.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(n=>oe(n)):i},"wrapCharByChar"),Wr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Pt),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Rt.test(u),h=se(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(n+h>e&&n>0){r?o.push(oe(a)):o.push(a),a="",n=0;continue}a+=u,n+=h,c+=1}return a&&(r?o.push(oe(a)):o.push(a)),o},"wrapWithWordBoundaries"),Dr=v((t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Pt),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Rt.test(u),h=se(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(h>e){a&&o.push(_e(r?oe(a):a));const p=_t(u,e,r);if(p.length>0){for(let $=0;$<p.length-1;$+=1)o.push(p[$]);a=p.at(-1),n=se(a)}else a="",n=0;c+=1;continue}if(n+h>e&&n>0&&(o.push(_e(r?oe(a):a)),a="",n=0,r&&l)){c+=1;continue}a+=u,n+=h,c+=1}return a&&o.push(_e(r?oe(a):a)),o},"wrapAndBreakWords"),de={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},qr=v((t,e={})=>{const{removeZeroWidthCharacters:r=!0,trim:s=!0,width:i=80,wrapMode:o=de.PRESERVE_WORDS}=e;if(s&&t.trim()==="")return"";let a=t.normalize("NFC").replaceAll(`\r