@visulima/vis 1.0.0-alpha.29 → 1.0.0-alpha.30

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/binx.js +1 -1
  4. package/dist/packem_chunks/bin.js +368 -367
  5. package/dist/packem_chunks/bloom-status.js +1 -1
  6. package/dist/packem_chunks/bloom-sync.js +1 -1
  7. package/dist/packem_chunks/config.js +15 -15
  8. package/dist/packem_chunks/doctor-probe.js +1 -1
  9. package/dist/packem_chunks/fix.js +1 -1
  10. package/dist/packem_chunks/handler.js +1 -1
  11. package/dist/packem_chunks/handler10.js +1 -1
  12. package/dist/packem_chunks/handler11.js +4 -4
  13. package/dist/packem_chunks/handler12.js +1 -1
  14. package/dist/packem_chunks/handler13.js +2 -2
  15. package/dist/packem_chunks/handler14.js +1 -1
  16. package/dist/packem_chunks/handler15.js +1 -1
  17. package/dist/packem_chunks/handler16.js +1 -1
  18. package/dist/packem_chunks/handler17.js +1 -1
  19. package/dist/packem_chunks/handler18.js +1 -1
  20. package/dist/packem_chunks/handler19.js +1 -1
  21. package/dist/packem_chunks/handler2.js +1 -1
  22. package/dist/packem_chunks/handler20.js +1 -1
  23. package/dist/packem_chunks/handler21.js +2 -2
  24. package/dist/packem_chunks/handler22.js +2 -2
  25. package/dist/packem_chunks/handler23.js +1 -1
  26. package/dist/packem_chunks/handler25.js +1 -1
  27. package/dist/packem_chunks/handler26.js +1 -1
  28. package/dist/packem_chunks/handler27.js +1 -1
  29. package/dist/packem_chunks/handler28.js +1 -1
  30. package/dist/packem_chunks/handler29.js +1 -1
  31. package/dist/packem_chunks/handler30.js +7 -7
  32. package/dist/packem_chunks/handler32.js +1 -1
  33. package/dist/packem_chunks/handler33.js +1 -1
  34. package/dist/packem_chunks/handler34.js +4 -4
  35. package/dist/packem_chunks/handler35.js +1 -1
  36. package/dist/packem_chunks/handler36.js +1 -1
  37. package/dist/packem_chunks/handler37.js +5 -5
  38. package/dist/packem_chunks/handler38.js +4 -4
  39. package/dist/packem_chunks/handler39.js +1 -1
  40. package/dist/packem_chunks/handler4.js +1 -1
  41. package/dist/packem_chunks/handler40.js +2 -2
  42. package/dist/packem_chunks/handler41.js +6 -6
  43. package/dist/packem_chunks/handler42.js +13 -13
  44. package/dist/packem_chunks/handler43.js +5 -5
  45. package/dist/packem_chunks/handler44.js +5 -5
  46. package/dist/packem_chunks/handler45.js +1 -1
  47. package/dist/packem_chunks/handler46.js +12 -12
  48. package/dist/packem_chunks/handler47.js +40 -40
  49. package/dist/packem_chunks/handler48.js +15 -15
  50. package/dist/packem_chunks/handler49.js +3 -3
  51. package/dist/packem_chunks/handler5.js +1 -1
  52. package/dist/packem_chunks/handler50.js +9 -9
  53. package/dist/packem_chunks/handler51.js +1 -1
  54. package/dist/packem_chunks/handler52.js +1 -1
  55. package/dist/packem_chunks/handler6.js +1 -1
  56. package/dist/packem_chunks/handler7.js +1 -1
  57. package/dist/packem_chunks/handler8.js +1 -1
  58. package/dist/packem_chunks/handler9.js +1 -1
  59. package/dist/packem_chunks/heal-accept.js +1 -1
  60. package/dist/packem_chunks/heal.js +1 -1
  61. package/dist/packem_chunks/help-command.js +7 -7
  62. package/dist/packem_chunks/index.js +6 -6
  63. package/dist/packem_chunks/keys-refresh.js +1 -1
  64. package/dist/packem_chunks/list.js +2 -2
  65. package/dist/packem_chunks/loader.js +1 -1
  66. package/dist/packem_chunks/loader2.js +1 -1
  67. package/dist/packem_chunks/prune.js +1 -1
  68. package/dist/packem_chunks/run.js +1 -1
  69. package/dist/packem_chunks/status.js +1 -1
  70. package/dist/packem_chunks/sync.js +1 -1
  71. package/dist/packem_chunks/sync2.js +1 -1
  72. package/dist/packem_chunks/tripwire.js +2 -2
  73. package/dist/packem_chunks/verify-lockfile.js +1 -1
  74. package/dist/packem_shared/Table-DoSoazT6-DwnyTUsA.js +12 -0
  75. package/dist/packem_shared/{advisories-DpgSuWDH.js → advisories-BxXiKFbL.js} +1 -1
  76. package/dist/packem_shared/{affected-shas-BkXXecyi.js → affected-shas-BdnlfiV1.js} +1 -1
  77. package/dist/packem_shared/{ai-fix-CfFWatGY.js → ai-fix-BkPUHA0z.js} +1 -1
  78. package/dist/packem_shared/{applyDefaults-DLvOqXGX.js → applyDefaults-BogleaFi.js} +1 -1
  79. package/dist/packem_shared/build-scripts-DE6U8jVq.js +1 -0
  80. package/dist/packem_shared/{cyclonedx-B04lIvwu.js → cyclonedx-BpGVHqSW.js} +1 -1
  81. package/dist/packem_shared/{dependency-scan-B9wTcLxf.js → dependency-scan-BUbOcMwX.js} +1 -1
  82. package/dist/packem_shared/{docker-DxA80dRx.js → docker-CTE3s4LW.js} +1 -1
  83. package/dist/packem_shared/{failure-log-n3j_-w8s.js → failure-log-34Wl3npC.js} +1 -1
  84. package/dist/packem_shared/glob-D_7bct6p-D8itOHsr.js +1 -0
  85. package/dist/packem_shared/{index-BfG9_znI.js → index-D1xC1Y_R.js} +1 -1
  86. package/dist/packem_shared/index-hoWfZmNo.js +30 -0
  87. package/dist/packem_shared/{lifecycle-NHIKDiCh.js → lifecycle-CXaqPGAQ.js} +2 -2
  88. package/dist/packem_shared/lockfile-CrT86D6d.js +1 -0
  89. package/dist/packem_shared/{lockfile-DAuTDwow.js → lockfile-Cu2BH6bl.js} +1 -1
  90. package/dist/packem_shared/{manifests-B7wUR3Rk.js → manifests-BzWpKW8F.js} +1 -1
  91. package/dist/packem_shared/{min-release-age-YyNI7gqV.js → min-release-age-BPVXwPUg.js} +2 -2
  92. package/dist/packem_shared/{native-config-sync-CgRIIRZV.js → native-config-sync-BRZZetn3.js} +8 -8
  93. package/dist/packem_shared/{osv-bloom-BQSIHt5h.js → osv-bloom-DSZcHLsM.js} +1 -1
  94. package/dist/packem_shared/{pm-runner-Ta_yz2uP.js → pm-runner-DmKT2FqF.js} +1 -1
  95. package/dist/packem_shared/{provenance-DoEp2uOo.js → provenance-DkCA8BrN.js} +1 -1
  96. package/dist/packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js +1 -0
  97. package/dist/packem_shared/{registry-keys-CD1xHavV.js → registry-keys-Mixm4eAY.js} +1 -1
  98. package/dist/packem_shared/{resolve-explicit-DpSc7RN2.js → resolve-explicit-D5E72FfN.js} +1 -1
  99. package/dist/packem_shared/runtime-check-CilFOqUU.js +1 -0
  100. package/dist/packem_shared/{s1ngularity-CIX7UcT5.js → s1ngularity-Qxc6tRRI.js} +1 -1
  101. package/dist/packem_shared/{scan-progress-CTVVf9WW.js → scan-progress-DVtCtI2z.js} +1 -1
  102. package/dist/packem_shared/{selectors-BU8aTRQm.js → selectors-DkgYFzdq.js} +1 -1
  103. package/dist/packem_shared/{signatures-BHM7cnqB.js → signatures-byuFrtAH.js} +1 -1
  104. package/dist/packem_shared/{toolchain-juKl-WgV.js → toolchain-DoG6b_G_.js} +2 -2
  105. package/dist/packem_shared/{typosquats-DRKU6d2S.js → typosquats-BiDxQj7R.js} +1 -1
  106. package/dist/packem_shared/{verify-DA80ja1b.js → verify-cLcZwKqe.js} +1 -1
  107. package/dist/packem_shared/{watch-DdR-pFzX.js → watch-DEL0yol9.js} +1 -1
  108. package/dist/packem_shared/{watch-loop-C8csFvRU.js → watch-loop-C31Ar7BX.js} +3 -3
  109. package/index.d.ts +201 -201
  110. package/index.js +26 -26
  111. package/package.json +10 -10
  112. package/dist/packem_shared/Table-3pFgIUZ2-DABgc6rj.js +0 -12
  113. package/dist/packem_shared/build-scripts-D-ysm_bS.js +0 -1
  114. package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +0 -1
  115. package/dist/packem_shared/index-BDF8gawl.js +0 -29
  116. package/dist/packem_shared/lockfile-CoeFxWAv.js +0 -1
  117. package/dist/packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js +0 -1
  118. package/dist/packem_shared/runtime-check-Cbtb_Utb.js +0 -1
@@ -1,8 +1,8 @@
1
- var ft=Object.defineProperty;var m=(e,t)=>ft(e,"name",{value:t,configurable:!0});import{createRequire as ht}from"node:module";import{B as mt,M as J,r as Z,j as bt,I as O,N as y,q as T,e as ee}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{b as wt,c as H,f as D,n as me}from"../packem_shared/index-BDF8gawl.js";const pt=ht(import.meta.url),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=m(e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[t,r]=F.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return F.getBuiltinModule(e)}return pt(e)},"__cjs_getBuiltinModule"),{createRequire:yt}=gt("node:module");var $t=Object.defineProperty,vt=m((e,t)=>$t(e,"name",{value:t,configurable:!0}),"f$2"),Ot=Object.defineProperty,Nt=vt((e,t)=>Ot(e,"name",{value:t,configurable:!0}),"s"),jt=Object.defineProperty,At=Nt((e,t)=>jt(e,"name",{value:t,configurable:!0}),"a");const Pt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,ye=At(e=>{let[,t]=Pt.exec(e)??[];const r=t?t.length:0;if(r===3){const i=t.charAt(0),a=t.charAt(1),o=t.charAt(2);t=i+i+a+a+o+o}else if(r!==6)return[0,0,0];const n=Number.parseInt(t,16);return[n>>16&255,n>>8&255,n&255]},"convertHexToRgb");var St=Object.defineProperty,Wt=m((e,t)=>St(e,"name",{value:t,configurable:!0}),"o$1"),xt=Object.defineProperty,It=Wt((e,t)=>xt(e,"name",{value:t,configurable:!0}),"s"),Et=Object.defineProperty,Se=It((e,t)=>Et(e,"name",{value:t,configurable:!0}),"e");const Ye=Se((e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(r/51),"rgbToAnsi256"),we=Se(e=>{let t,r,n;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=r=n=((e-232)*10+8)/255;else{e-=16;const o=e%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}const i=Math.max(t,r,n)*2;if(i===0)return 30;const a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===2?a+60:a},"ansi256To16"),Ce=Se((e,t,r)=>we(Ye(e,t,r)),"rgbToAnsi16");var Bt=Object.defineProperty,Je=m((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"m$1"),Ct=Object.defineProperty,k=Je((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"u"),Mt=Object.defineProperty,Rt=k((e,t)=>Mt(e,"name",{value:t,configurable:!0}),"e");function ie({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}m(ie,"$$3");Je(ie,"j");k(ie,"t$1");Rt(ie,"ansiRegex");var Tt=Object.defineProperty,kt=k((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"n$1");const A=kt((e,t,r)=>t>e?t:Math.min(e,r),"clamp");var _t=Object.defineProperty,w=k((e,t)=>_t(e,"name",{value:t,configurable:!0}),"b");const h=39,p=49,Me=10,$e=mt(),Ze={close:"",open:""},l=$e>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>Ze,Re=w(e=>(t,r,n)=>e(Ye(Number(t),Number(r),Number(n))),"createRgbFunction"),Te=w(e=>t=>{const[r,n,i]=ye(t);return e(r,n,i)},"createHexFunction");let ve=w(e=>l(`38;5;${String(e)}`,h),"createAnsi256"),Oe=w(e=>l(`48;5;${String(e)}`,p),"createBgAnsi256"),te=w((e,t,r)=>l(`38;2;${String(e)};${String(t)};${String(r)}`,h),"createRgb"),re=w((e,t,r)=>l(`48;2;${String(e)};${String(t)};${String(r)}`,p),"createBgRgb");$e===1?(ve=w(e=>l(we(Number(e)),h),"createAnsi256"),Oe=w(e=>l(we(Number(e))+Me,p),"createBgAnsi256"),te=w((e,t,r)=>l(Ce(Number(e),Number(t),Number(r)),h),"createRgb"),re=w((e,t,r)=>l(Ce(Number(e),Number(t),Number(r))+Me,p),"createBgRgb")):$e===2&&(te=Re(ve),re=Re(Oe));const ke={bold:l(1,22),dim:l(2,22),hidden:l(8,28),inverse:l(7,27),italic:l(3,23),overline:l(53,55),reset:l(0,0),strike:l(9,29),strikethrough:l(9,29),underline:l(4,24),visible:Ze},_e={bgBlack:l(40,p),bgBlackBright:l(100,p),bgBlue:l(44,p),bgBlueBright:l(104,p),bgCyan:l(46,p),bgCyanBright:l(106,p),bgGray:l(100,p),bgGreen:l(42,p),bgGreenBright:l(102,p),bgGrey:l(100,p),bgMagenta:l(45,p),bgMagentaBright:l(105,p),bgRed:l(41,p),bgRedBright:l(101,p),bgWhite:l(47,p),bgWhiteBright:l(107,p),bgYellow:l(43,p),bgYellowBright:l(103,p),black:l(30,h),blackBright:l(90,h),blue:l(34,h),blueBright:l(94,h),cyan:l(36,h),cyanBright:l(96,h),gray:l(90,h),green:l(32,h),greenBright:l(92,h),grey:l(90,h),magenta:l(35,h),magentaBright:l(95,h),red:l(31,h),redBright:l(91,h),white:l(37,h),whiteBright:l(97,h),yellow:l(33,h),yellowBright:l(93,h)},Le={bg:w(e=>Oe(A(e,0,255)),"bg"),bgHex:Te(re),bgRgb:w((e,t,r)=>re(A(e,0,255),A(t,0,255),A(r,0,255)),"bgRgb"),fg:w(e=>ve(A(e,0,255)),"fg"),hex:Te(te),rgb:w((e,t,r)=>te(A(e,0,255),A(t,0,255),A(r,0,255)),"rgb")};var Lt=Object.defineProperty,Ft=k((e,t)=>Lt(e,"name",{value:t,configurable:!0}),"s");const Ht=Ft((e,t,r)=>{if(t==="")return e;let n=e.indexOf(t);if(n<0)return e;const i=t.length;let a=0,o="";for(;~n;)o+=e.slice(a,n)+r,a=n+i,n=e.indexOf(t,a);return o+e.slice(a)},"stringReplaceAll");var Ut=Object.defineProperty,G=k((e,t)=>Ut(e,"name",{value:t,configurable:!0}),"a");const P={};let Ne=null;const Vt=G((e,t,r)=>{if(!e)return"";let n;if(e.raw===void 0?n=String(e):n=String.raw(e,...t),n.includes("\x1B"))for(let i=r;i;i=i.props)n=Ht(n,i.close,i.open);return n.includes(`
2
- `)&&(n=n.replace(/(\r*\n)/g,`${r.closeStack}$1${r.openStack}`)),r.openStack+n+r.closeStack},"wrapText"),je=G(({props:e},{close:t,open:r})=>{const n=(e?.openStack??"")+r,i=t+(e?.closeStack??""),a=G((o,...s)=>Vt(o,s,a.props),"style");return Object.setPrototypeOf(a,Ne),a.props={close:t,closeStack:i,open:r,openStack:n,props:e},a.open=n,a.close=i,a},"createStyle"),Gt=G(function(){const e=G(t=>String(t),"self");e.strip=t=>t.replaceAll(ie(),"");for(const t in _e)P[t]={get(){const r=je(this,_e[t]);return Object.defineProperty(this,t,{value:r}),r}};for(const t in ke)P[t]={get(){const r=je(this,ke[t]);return Object.defineProperty(this,t,{value:r}),r}};return Ne=Object.defineProperties({},P),Object.setPrototypeOf(e,Ne),e},"Colorize");for(const e in Le)P[e]={get(){return(...t)=>je(this,Le[e](...t))}};P.ansi256=P.fg;P.bgAnsi256=P.bg;var qt=Object.defineProperty,zt=m((e,t)=>qt(e,"name",{value:t,configurable:!0}),"g$1"),Dt=Object.defineProperty,ae=zt((e,t)=>Dt(e,"name",{value:t,configurable:!0}),"i"),Yt=Object.defineProperty,Jt=ae((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"n");const Ke=Jt(e=>(t,...r)=>{if(!Array.isArray(t)||!Array.isArray(t.raw))throw new TypeError("A tagged template literal must be provided");const n=[t.raw[0]];for(let i=1;i<t.raw.length;i+=1)n.push(String(r[i-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(t.raw[i]));return e(n.join(""))},"makeColorizeTemplate");var Zt=Object.defineProperty,Kt=ae((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"e$1");const Qt=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
3
- `],["r","\r"],["t"," "],["v","\v"]]),Qe=Kt(e=>{const t=e.startsWith("u"),r=e[1]==="{";return t&&!r&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):Qt.get(e)??e},"unescape");var Xt=Object.defineProperty,oe=ae((e,t)=>Xt(e,"name",{value:t,configurable:!0}),"u");const er=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,Fe=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,tr=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,rr=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,nr=/\s*,\s*/,ir=oe((e,t)=>{const r=[],n=t.trim().split(nr);let i;for(const a of n){const o=Number(a);if(!Number.isNaN(o))r.push(o);else if(i=tr.exec(a))r.push(i[2].replaceAll(rr,(s,u,c)=>u?Qe(u):c));else throw new Error(`Invalid template style argument: ${a} (in style '${e}')`)}return r},"parseArguments"),ar=oe(e=>{Fe.lastIndex=0;const t=[];let r;for(;(r=Fe.exec(e))!==null;){const n=r[1];r[2]?t.push([n,...ir(n,r[2])]):r[3]||r[4]?(r[3]&&t.push(["rgb",...ye(r[3])]),r[4]&&t.push(["bgRgb",...ye(r[4])])):t.push([n])}return t},"parseStyle"),He=oe((e,t)=>{const r={};for(const i of t)for(const a of i.styles)r[a[0]]=i.inverse?void 0:a.slice(1);let n=e;for(const[i,a]of Object.entries(r))if(Array.isArray(a)){if(!(i in n))throw new Error(`Unknown style: ${i}`);n=a.length>0?n[i](...a):n[i]}return n},"buildStyle"),Xe=oe(e=>t=>{const r=[],n=[];let i=[];if(t.replaceAll(er,(a,o,s,u,c,d)=>{if(o)i.push(Qe(o));else if(u){const f=i.join("");i=[],n.push(r.length===0?f:He(e,r)(f)),r.push({inverse:s,styles:ar(u)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in template literal");n.push(He(e,r)(i.join(""))),i=[],r.pop()}else i.push(d)}),n.push(i.join("")),r.length>0)throw new Error(`template literal is missing ${String(r.length)} closing bracket${r.length===1?"":"s"} (\`}\`)`);return n.join("")},"makeTemplate");var or=Object.defineProperty,sr=ae((e,t)=>or(e,"name",{value:t,configurable:!0}),"e");const lr=new Gt;sr(e=>Ke(Xe(e)),"makeTaggedTemplate");const ur=Xe(lr),cr=Ke(ur);var dr=Object.defineProperty,N=m((e,t)=>dr(e,"name",{value:t,configurable:!0}),"m"),fr=Object.defineProperty,g=N((e,t)=>fr(e,"name",{value:t,configurable:!0}),"d");const hr=yt(import.meta.url),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=g(e=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[t,r]=R.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return R.getBuiltinModule(e)}return hr(e)},"__cjs_getBuiltinModule"),x=R,{execFileSync:pr}=se("node:child_process"),V=se("node:fs"),gr=se("node:tty"),mr=se("node:os");var br=Object.defineProperty,We=g((e,t)=>br(e,"name",{value:t,configurable:!0}),"u$2"),yr=Object.defineProperty,le=We((e,t)=>yr(e,"name",{value:t,configurable:!0}),"l");const wr=[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],$r=12288,vr=65510,Or=[12288,12288,65281,65376,65504,65510],Nr=8361,jr=65518,Ar=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Pr=32,Sr=10630,Wr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],xr=4352,Ir=262141,et=[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];var Er=Object.defineProperty,Br=le((e,t)=>Er(e,"name",{value:t,configurable:!0}),"r$1");const q=Br((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),a=i*2;if(t<e[a])n=i-1;else if(t>e[a+1])r=i+1;else return!0}return!1},"isInRange");var Cr=Object.defineProperty,E=le((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r");const Ue=19968,[Mr,Rr]=_(et);function _(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],a=e[n+1];if(Ue>=i&&Ue<=a)return[i,a];a-i>r-t&&(t=i,r=a)}return[t,r]}m(_,"S$1");N(_,"F");g(_,"c$2");We(_,"f");le(_,"k");E(_,"findWideFastPathRange");const tt=E(e=>e<161||e>1114109?!1:q(wr,e),"isAmbiguous"),rt=E(e=>e<$r||e>vr?!1:q(Or,e),"isFullWidth"),Tr=E(e=>e<Nr||e>jr?!1:q(Ar,e),"isHalfWidth"),kr=E(e=>e<Pr||e>Sr?!1:q(Wr,e),"isNarrow"),nt=E(e=>e>=Mr&&e<=Rr?!0:e<xr||e>Ir?!1:q(et,e),"isWide");function L(e){return tt(e)?"ambiguous":rt(e)?"fullwidth":Tr(e)?"halfwidth":kr(e)?"narrow":nt(e)?"wide":"neutral"}m(L,"P$1");N(L,"B");g(L,"g$3");We(L,"S");le(L,"getCategory");E(L,"getCategory");var _r=Object.defineProperty,ue=g((e,t)=>_r(e,"name",{value:t,configurable:!0}),"i$2"),Lr=Object.defineProperty,ce=ue((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"a"),Fr=Object.defineProperty,xe=ce((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"e");function B(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}m(B,"N$1");N(B,"A");g(B,"s$1");ue(B,"s");ce(B,"r");xe(B,"validate");function C(e){return B(e),L(e)}m(C,"I");N(C,"x");g(C,"r$3");ue(C,"p");ce(C,"eastAsianWidthType");xe(C,"eastAsianWidthType");function z(e,{ambiguousAsWide:t=!1}={}){return B(e),rt(e)||nt(e)||t&&tt(e)?2:1}m(z,"Y");N(z,"Z");g(z,"o$2");ue(z,"W");ce(z,"eastAsianWidth");xe(z,"eastAsianWidth");var Hr=Object.defineProperty,Ur=g((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"E"),Vr=Object.defineProperty,Gr=Ur((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"A"),qr=Object.defineProperty,de=Gr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"d");const Ve=new Map,Y=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,K=de(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),zr=de((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Ve.get(r);if(i||(i=new Map,Ve.set(r,i)),i.has(n))return i.get(n);let a;if(K(e)==="latin")a=t.width.regular;else if(K(e)==="control")a=t.width.control;else if(K(e)==="wide")a=t.width.wide;else switch(C(e)){case"ambiguous":{a=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{a=t.width.fullWidth;break}case"wide":{a=t.width.wide;break}default:a=t.width.regular}return i.set(n,a),a},"getCachedCharWidth"),Dr=de(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ae=de((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ae(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,a=i>1e4;let o=0,s=0,u=i,c=!1;const d=e.includes("\x1B")||e.includes("›");for(;o<i;){if(d&&(e[o]==="\x1B"||e[o]==="›")){if(e.startsWith("\x1B]8;;",o)){const v="\x1B]8;;\x07",W=v.length,he=e.indexOf("\x07",o+5);if(he!==-1){const pe=e.indexOf(v,he+1);if(pe!==-1){const ct=pe+W,dt=e.slice(he+1,pe).replace(H,""),Be=Ae(dt,{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,n-s),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),ge=Be.width;if(Be.truncated)c=!0,u=Math.min(u,o);else if(s+ge>n&&(u=Math.min(u,o),c=!0,s+ge>r.truncation.limit))break;if(s+=ge,o=ct,c&&s>=r.truncation.limit)break;continue}}}if(H.lastIndex=o,H.test(e)){const v=H.lastIndex-o,W=r.truncation.countAnsiEscapeCodes?v:r.width.ansi;if(s+W>n&&(u=Math.min(u,o),s+W>r.truncation.limit)){c=!0;break}s+=W,o=H.lastIndex;continue}}const j=e.codePointAt(o);if(j===8203||j===65279||j>=8288&&j<=8292){o+=1;continue}if(j===9){if(s+r.width.tab>n&&(u=Math.min(u,o),s+r.width.tab>r.truncation.limit)){c=!0;break}s+=r.width.tab,o+=1;continue}if(Y.lastIndex=o,Y.test(e)){const v=(Y.lastIndex-o)*r.width.regular;if(s+v>n){const W=Math.floor((n-s)/r.width.regular);if(u=Math.min(u,o+W),s+v>r.truncation.limit){c=!0;break}}s+=v,o=Y.lastIndex;continue}if((j<=31||j>=127&&j<=159)&&(D.lastIndex=o,D.test(e))){const v=(D.lastIndex-o)*r.width.control;if(s+v>n&&(u=Math.min(u,o+Math.floor((n-s)/r.width.control)),s+v>r.truncation.limit)){c=!0;break}s+=v,o=D.lastIndex;continue}if(me.lastIndex=o,me.test(e)){if(s+r.width.emoji>n&&(u=Math.min(u,o),s+r.width.emoji>r.truncation.limit)){c=!0;break}s+=r.width.emoji,o=me.lastIndex;continue}const M=e.codePointAt(o)??0;if(Dr(M)){o+=M>65535?2:1;continue}let $;if(a)$=zr(M,r);else switch(K(M)){case"control":{$=r.width.control;break}case"latin":{$=r.width.regular;break}case"wide":{$=r.width.wide;break}case"zero":{$=0;break}default:switch(C(M)){case"ambiguous":{$=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{$=r.width.fullWidth;break}case"wide":{$=r.width.wide;break}default:$=r.width.regular}}if(s+$>n&&(u=Math.min(u,o),s+$>r.truncation.limit)){c=!0;break}s+=$,o+=M>65535?2:1}let f=s,Ee=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,Ee=!0),{ellipsed:Ee,index:c?u:i,truncated:c,width:f}},"getStringTruncatedWidth");var Yr=Object.defineProperty,Jr=g((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"i$1"),Zr=Object.defineProperty,Kr=Jr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"e"),Qr=Object.defineProperty,Xr=Kr((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"r");const en=Xr((e,t={})=>Ae(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var tn=Object.defineProperty,S=g((e,t)=>tn(e,"name",{value:t,configurable:!0}),"n$1");const it=80,at=24,Pe=S((e,t,{shell:r,env:n}={})=>pr(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Q=S((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),ot=S((e,t)=>{const{columns:r,rows:n}=Q(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===it&&n===at))return{columns:r,rows:n}},"createIfNotDefault"),rn=S(()=>{if(x.platform!=="linux")return!0;try{const e=V.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function fe(){const{env:e,stdout:t,stderr:r}=x;if(t?.columns&&t?.rows)return Q(t.columns,t.rows);if(r?.columns&&r?.rows)return Q(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Q(e.COLUMNS,e.LINES);const n={columns:it,rows:at};return x.platform==="win32"?be()??n:x.platform==="darwin"?Ge()??be()??n:Ge()??be()??nn()??n}m(fe,"it");N(fe,"fe");g(fe,"O$1");S(fe,"terminalSize");const Ge=S(()=>{try{const e=x.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:t,rows:r}=gr.WriteStream(V.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),be=S(()=>{try{const e=Pe("tput",["cols"],{env:{TERM:"dumb",...x.env}}),t=Pe("tput",["lines"],{env:{TERM:"dumb",...x.env}});if(e&&t)return ot(e,t)}catch{}},"tput"),nn=S(()=>{try{if(!rn())return;const e=Pe("resize",["-u"]).match(/\d+/g);if(e.length===2)return ot(e[0],e[1])}catch{}},"resize");var an=Object.defineProperty,on=g((e,t)=>an(e,"name",{value:t,configurable:!0}),"s");const U=new Map,sn=500,b=on(e=>{if(!e||e==="")return"";const t=U.get(e);if(t!==void 0)return t;const r=cr(Object.assign([],{raw:[e]}));if(U.size>=sn){const n=U.keys().next().value;n!==void 0&&U.delete(n)}return U.set(e,r),r},"templateFormat");var ln=Object.defineProperty,un=g((e,t)=>ln(e,"name",{value:t,configurable:!0}),"t$1");const X=un(()=>{const e=wt().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"getTerminalWidth");var cn=Object.defineProperty,dn=g((e,t)=>cn(e,"name",{value:t,configurable:!0}),"t");class st{static{m(this,"mt")}static{N(this,"he")}static{g(this,"n")}static{dn(this,"BaseSection")}lines;constructor(){this.lines=[]}add(t){this.lines.push(t)}toString(){return this.lines.join(mr.EOL)}header(t){this.add(bt(t)),this.lines.push("")}}var fn=Object.defineProperty,ne=g((e,t)=>fn(e,"name",{value:t,configurable:!0}),"g");const hn=ne(e=>e!==void 0&&e>0?e:fe().columns,"resolveTerminalWidth"),pn=ne((e,t,r,n)=>{if(e.length===0||e.some(c=>c.length!==2))return;let i=0;for(const c of e){const d=c[0];if(d===void 0)continue;const f=en(d);f>i&&(i=f)}if(i===0)return;const a=r+n,o=i+a,s=20+a;if(o+s>t)return;const u=t-o;return[o,u]},"computeColumnWidths");class gn extends st{static{m(this,"Ii")}static{N(this,"Wr")}static{g(this,"S")}static{ne(this,"ContentSection")}constructor(t){if(super(),t.header&&this.header(b(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(r=>typeof r=="string"))t.content.forEach(r=>{Array.isArray(r)?r.forEach(n=>{this.add(b(n))}):this.add(b(r))});else if(typeof t.content=="string")this.add(b(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const r=J({showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:X(),truncateOverflow:!1,wordWrap:!0});return r.addRow([b(t)]),r.toString()}if(Array.isArray(t)&&t.every(r=>typeof r=="string"||Array.isArray(r)&&r.every(n=>typeof n=="string"))){const r=hn(X()),n=ne(s=>Array.isArray(s)?s.map(u=>b(u)):[b(s)],"formatRow"),i=t.map(s=>n(s)),a=pn(i,r,4,1),o=J({columnWidths:a,showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:r,truncateOverflow:!1,wordWrap:!0});return i.forEach(s=>{a!==void 0&&s.length===2?o.addRow([{content:s[0],wordWrap:!1},s[1]]):o.addRow(s)}),o.toString()}if(typeof t=="object"){const r=t;if(!r.options||!r.data)throw new Error(`Must have an "options" or "data" property
4
- ${JSON.stringify(t)}`);const n=J({showHeader:!1,style:{border:Z,paddingLeft:4,paddingRight:1},terminalWidth:X(),truncateOverflow:!1,wordWrap:!0});return r.data.forEach(i=>{Array.isArray(i)?n.addRow(i.map(a=>b(a))):n.addRow([b(i)])}),n.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
1
+ var Ke=Object.defineProperty;var m=(e,t)=>Ke(e,"name",{value:t,configurable:!0});import{createRequire as Ze}from"node:module";import{B as et,M as U,r as V,j as tt,I as N,N as w,q as W,e as z}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{h as it,E as R,c as L,b as ne}from"../packem_shared/index-hoWfZmNo.js";const Qe=Ze(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=m(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,n]=M.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return M.getBuiltinModule(e)}return Qe(e)},"__cjs_getBuiltinModule"),{createRequire:nt}=Xe("node:module");var rt=Object.defineProperty,ot=m((e,t)=>rt(e,"name",{value:t,configurable:!0}),"f$2"),at=Object.defineProperty,st=ot((e,t)=>at(e,"name",{value:t,configurable:!0}),"s"),lt=Object.defineProperty,ct=st((e,t)=>lt(e,"name",{value:t,configurable:!0}),"a");const ut=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,re=ct(e=>{let[,t]=ut.exec(e)??[];const n=t?t.length:0;if(n===3){const r=t.charAt(0),o=t.charAt(1),a=t.charAt(2);t=r+r+o+o+a+a}else if(n!==6)return[0,0,0];const i=Number.parseInt(t,16);return[i>>16&255,i>>8&255,i&255]},"convertHexToRgb");var dt=Object.defineProperty,ht=m((e,t)=>dt(e,"name",{value:t,configurable:!0}),"o$1"),ft=Object.defineProperty,pt=ht((e,t)=>ft(e,"name",{value:t,configurable:!0}),"s"),gt=Object.defineProperty,fe=pt((e,t)=>gt(e,"name",{value:t,configurable:!0}),"e");const Me=fe((e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(n/51),"rgbToAnsi256"),oe=fe(e=>{let t,n,i;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=n=i=((e-232)*10+8)/255;else{e-=16;const a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}const r=Math.max(t,n,i)*2;if(r===0)return 30;const o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return r===2?o+60:o},"ansi256To16"),we=fe((e,t,n)=>oe(Me(e,t,n)),"rgbToAnsi16");var mt=Object.defineProperty,Re=m((e,t)=>mt(e,"name",{value:t,configurable:!0}),"m"),bt=Object.defineProperty,P=Re((e,t)=>bt(e,"name",{value:t,configurable:!0}),"u"),wt=Object.defineProperty,yt=P((e,t)=>wt(e,"name",{value:t,configurable:!0}),"e");function J({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}m(J,"$$3");Re(J,"j");P(J,"t$1");yt(J,"ansiRegex");var $t=Object.defineProperty,vt=P((e,t)=>$t(e,"name",{value:t,configurable:!0}),"n$1");const A=vt((e,t,n)=>t>e?t:Math.min(e,n),"clamp");var Nt=Object.defineProperty,y=P((e,t)=>Nt(e,"name",{value:t,configurable:!0}),"b");const p=39,g=49,ye=10,ae=et(),ke={close:"",open:""},l=ae>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>ke,$e=y(e=>(t,n,i)=>e(Me(Number(t),Number(n),Number(i))),"createRgbFunction"),ve=y(e=>t=>{const[n,i,r]=re(t);return e(n,i,r)},"createHexFunction");let se=y(e=>l(`38;5;${String(e)}`,p),"createAnsi256"),le=y(e=>l(`48;5;${String(e)}`,g),"createBgAnsi256"),D=y((e,t,n)=>l(`38;2;${String(e)};${String(t)};${String(n)}`,p),"createRgb"),Y=y((e,t,n)=>l(`48;2;${String(e)};${String(t)};${String(n)}`,g),"createBgRgb");ae===1?(se=y(e=>l(oe(Number(e)),p),"createAnsi256"),le=y(e=>l(oe(Number(e))+ye,g),"createBgAnsi256"),D=y((e,t,n)=>l(we(Number(e),Number(t),Number(n)),p),"createRgb"),Y=y((e,t,n)=>l(we(Number(e),Number(t),Number(n))+ye,g),"createBgRgb")):ae===2&&(D=$e(se),Y=$e(le));const Ne={bold:l(1,22),dim:l(2,22),hidden:l(8,28),inverse:l(7,27),italic:l(3,23),overline:l(53,55),reset:l(0,0),strike:l(9,29),strikethrough:l(9,29),underline:l(4,24),visible:ke},Oe={bgBlack:l(40,g),bgBlackBright:l(100,g),bgBlue:l(44,g),bgBlueBright:l(104,g),bgCyan:l(46,g),bgCyanBright:l(106,g),bgGray:l(100,g),bgGreen:l(42,g),bgGreenBright:l(102,g),bgGrey:l(100,g),bgMagenta:l(45,g),bgMagentaBright:l(105,g),bgRed:l(41,g),bgRedBright:l(101,g),bgWhite:l(47,g),bgWhiteBright:l(107,g),bgYellow:l(43,g),bgYellowBright:l(103,g),black:l(30,p),blackBright:l(90,p),blue:l(34,p),blueBright:l(94,p),cyan:l(36,p),cyanBright:l(96,p),gray:l(90,p),green:l(32,p),greenBright:l(92,p),grey:l(90,p),magenta:l(35,p),magentaBright:l(95,p),red:l(31,p),redBright:l(91,p),white:l(37,p),whiteBright:l(97,p),yellow:l(33,p),yellowBright:l(93,p)},Ae={bg:y(e=>le(A(e,0,255)),"bg"),bgHex:ve(Y),bgRgb:y((e,t,n)=>Y(A(e,0,255),A(t,0,255),A(n,0,255)),"bgRgb"),fg:y(e=>se(A(e,0,255)),"fg"),hex:ve(D),rgb:y((e,t,n)=>D(A(e,0,255),A(t,0,255),A(n,0,255)),"rgb")};var Ot=Object.defineProperty,At=P((e,t)=>Ot(e,"name",{value:t,configurable:!0}),"s");const St=At((e,t,n)=>{if(t==="")return e;let i=e.indexOf(t);if(i<0)return e;const r=t.length;let o=0,a="";for(;~i;)a+=e.slice(o,i)+n,o=i+r,i=e.indexOf(t,o);return a+e.slice(o)},"stringReplaceAll");var jt=Object.defineProperty,T=P((e,t)=>jt(e,"name",{value:t,configurable:!0}),"a");const S={};let ce=null;const xt=T((e,t,n)=>{if(!e)return"";let i;if(e.raw===void 0?i=String(e):i=String.raw(e,...t),i.includes("\x1B"))for(let r=n;r;r=r.props)i=St(i,r.close,r.open);return i.includes(`
2
+ `)&&(i=i.replace(/(\r*\n)/g,`${n.closeStack}$1${n.openStack}`)),n.openStack+i+n.closeStack},"wrapText"),ue=T(({props:e},{close:t,open:n})=>{const i=(e?.openStack??"")+n,r=t+(e?.closeStack??""),o=T((a,...s)=>xt(a,s,o.props),"style");return Object.setPrototypeOf(o,ce),o.props={close:t,closeStack:r,open:n,openStack:i,props:e},o.open=i,o.close=r,o},"createStyle"),Et=T(function(){const e=T(t=>String(t),"self");e.strip=t=>t.replaceAll(J(),"");for(const t in Oe)S[t]={get(){const n=ue(this,Oe[t]);return Object.defineProperty(this,t,{value:n}),n}};for(const t in Ne)S[t]={get(){const n=ue(this,Ne[t]);return Object.defineProperty(this,t,{value:n}),n}};return ce=Object.defineProperties({},S),Object.setPrototypeOf(e,ce),e},"Colorize");for(const e in Ae)S[e]={get(){return(...t)=>ue(this,Ae[e](...t))}};S.ansi256=S.fg;S.bgAnsi256=S.bg;var It=Object.defineProperty,Bt=m((e,t)=>It(e,"name",{value:t,configurable:!0}),"g"),Wt=Object.defineProperty,K=Bt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"i"),Pt=Object.defineProperty,Mt=K((e,t)=>Pt(e,"name",{value:t,configurable:!0}),"n");const Ce=Mt(e=>(t,...n)=>{if(!Array.isArray(t)||!Array.isArray(t.raw))throw new TypeError("A tagged template literal must be provided");const i=[t.raw[0]];for(let r=1;r<t.raw.length;r+=1)i.push(String(n[r-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(t.raw[r]));return e(i.join(""))},"makeColorizeTemplate");var Rt=Object.defineProperty,kt=K((e,t)=>Rt(e,"name",{value:t,configurable:!0}),"e$1");const Ct=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
3
+ `],["r","\r"],["t"," "],["v","\v"]]),Te=kt(e=>{const t=e.startsWith("u"),n=e[1]==="{";return t&&!n&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):Ct.get(e)??e},"unescape");var Tt=Object.defineProperty,Z=K((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"u");const _t=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,Se=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,Lt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Ft=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Ut=/\s*,\s*/,Vt=Z((e,t)=>{const n=[],i=t.trim().split(Ut);let r;for(const o of i){const a=Number(o);if(!Number.isNaN(a))n.push(a);else if(r=Lt.exec(o))n.push(r[2].replaceAll(Ft,(s,c,u)=>c?Te(c):u));else throw new Error(`Invalid template style argument: ${o} (in style '${e}')`)}return n},"parseArguments"),qt=Z(e=>{Se.lastIndex=0;const t=[];let n;for(;(n=Se.exec(e))!==null;){const i=n[1];n[2]?t.push([i,...Vt(i,n[2])]):n[3]||n[4]?(n[3]&&t.push(["rgb",...re(n[3])]),n[4]&&t.push(["bgRgb",...re(n[4])])):t.push([i])}return t},"parseStyle"),je=Z((e,t)=>{const n={};for(const r of t)for(const o of r.styles)n[o[0]]=r.inverse?void 0:o.slice(1);let i=e;for(const[r,o]of Object.entries(n))if(Array.isArray(o)){if(!(r in i))throw new Error(`Unknown style: ${r}`);i=o.length>0?i[r](...o):i[r]}return i},"buildStyle"),_e=Z(e=>t=>{const n=[],i=[];let r=[];if(t.replaceAll(_t,(o,a,s,c,u,d)=>{if(a)r.push(Te(a));else if(c){const f=r.join("");r=[],i.push(n.length===0?f:je(e,n)(f)),n.push({inverse:s,styles:qt(c)})}else if(u){if(n.length===0)throw new Error("Found extraneous } in template literal");i.push(je(e,n)(r.join(""))),r=[],n.pop()}else r.push(d)}),i.push(r.join("")),n.length>0)throw new Error(`template literal is missing ${String(n.length)} closing bracket${n.length===1?"":"s"} (\`}\`)`);return i.join("")},"makeTemplate");var Gt=Object.defineProperty,Ht=K((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"e");const zt=new Et;Ht(e=>Ce(_e(e)),"makeTaggedTemplate");const Dt=_e(zt),Yt=Ce(Dt);var Jt=Object.defineProperty,h=m((e,t)=>Jt(e,"name",{value:t,configurable:!0}),"a");const Kt=nt(import.meta.url),B=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=h(e=>{if(typeof B<"u"&&B.versions&&B.versions.node){const[t,n]=B.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return B.getBuiltinModule(e)}return Kt(e)},"R"),x=B,{execFileSync:Zt}=Q("node:child_process"),C=Q("node:fs"),Qt=Q("node:tty"),Xt=Q("node:os"),en=[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],tn=12288,nn=65510,rn=[12288,12288,65281,65376,65504,65510],on=8361,an=65518,sn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],ln=32,cn=10630,un=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],dn=4352,hn=262141,Le=[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],_=h((e,t)=>{let n=0,i=Math.floor(e.length/2)-1;for(;n<=i;){const r=Math.floor((n+i)/2),o=r*2;if(t<e[o])i=r-1;else if(t>e[o+1])n=r+1;else return!0}return!1},"$"),xe=19968,[fn,pn]=Fe(Le);function Fe(e){let t=e[0],n=e[1];for(let i=0;i<e.length;i+=2){const r=e[i],o=e[i+1];if(xe>=r&&xe<=o)return[r,o];o-r>n-t&&(t=r,n=o)}return[t,n]}m(Fe,"Wt");h(Fe,"N1");const gn=h(e=>e<161||e>1114109?!1:_(en,e),"I1"),mn=h(e=>e<tn||e>nn?!1:_(rn,e),"W1"),bn=h(e=>e<on||e>an?!1:_(sn,e),"$1"),wn=h(e=>e<ln||e>cn?!1:_(un,e),"O1"),yn=h(e=>e>=fn&&e<=pn?!0:e<dn||e>hn?!1:_(Le,e),"x1");function Ue(e){return gn(e)?"ambiguous":mn(e)?"fullwidth":bn(e)?"halfwidth":wn(e)?"narrow":yn(e)?"wide":"neutral"}m(Ue,"Mt");h(Ue,"E1");function Ve(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}m(Ve,"St");h(Ve,"v1");function pe(e){return Ve(e),Ue(e)}m(pe,"q");h(pe,"Y");const Ee=new Map,F=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,q=h(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","A"),$n=h((e,t)=>{const n=Math.floor(e/65536),i=e%65536;let r=Ee.get(n);if(r||(r=new Map,Ee.set(n,r)),r.has(i))return r.get(i);let o;if(q(e)==="latin")o=t.width.regular;else if(q(e)==="control")o=t.width.control;else if(q(e)==="wide")o=t.width.wide;else switch(pe(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return r.set(i,o),o},"A1"),vn=h(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"M1"),de=h((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?de(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},i=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:r}=e,o=r>1e4;let a=0,s=0,c=r,u=!1;const d=e.includes("\x1B")||e.includes("›");for(;a<r;){if(d&&(e[a]==="\x1B"||e[a]==="›")){if(e.startsWith("\x1B]8;;",a)){const v="\x1B]8;;\x07",j=v.length,X=e.indexOf("\x07",a+5);if(X!==-1){const ee=e.indexOf(v,X+1);if(ee!==-1){const Ye=ee+j,Je=e.slice(X+1,ee).replace(R,""),be=de(Je,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,i-s),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),te=be.width;if(be.truncated)u=!0,c=Math.min(c,a);else if(s+te>i&&(c=Math.min(c,a),u=!0,s+te>n.truncation.limit))break;if(s+=te,a=Ye,u&&s>=n.truncation.limit)break;continue}}}if(R.lastIndex=a,R.test(e)){const v=R.lastIndex-a,j=n.truncation.countAnsiEscapeCodes?v:n.width.ansi;if(s+j>i&&(c=Math.min(c,a),s+j>n.truncation.limit)){u=!0;break}s+=j,a=R.lastIndex;continue}}const O=e.codePointAt(a);if(O===8203||O===65279||O>=8288&&O<=8292){a+=1;continue}if(O===9){if(s+n.width.tab>i&&(c=Math.min(c,a),s+n.width.tab>n.truncation.limit)){u=!0;break}s+=n.width.tab,a+=1;continue}if(F.lastIndex=a,F.test(e)){const v=(F.lastIndex-a)*n.width.regular;if(s+v>i){const j=Math.floor((i-s)/n.width.regular);if(c=Math.min(c,a+j),s+v>n.truncation.limit){u=!0;break}}s+=v,a=F.lastIndex;continue}if((O<=31||O>=127&&O<=159)&&(L.lastIndex=a,L.test(e))){const v=(L.lastIndex-a)*n.width.control;if(s+v>i&&(c=Math.min(c,a+Math.floor((i-s)/n.width.control)),s+v>n.truncation.limit)){u=!0;break}s+=v,a=L.lastIndex;continue}if(ne.lastIndex=a,ne.test(e)){if(s+n.width.emoji>i&&(c=Math.min(c,a),s+n.width.emoji>n.truncation.limit)){u=!0;break}s+=n.width.emoji,a=ne.lastIndex;continue}const I=e.codePointAt(a)??0;if(vn(I)){a+=I>65535?2:1;continue}let $;if(o)$=$n(I,n);else switch(q(I)){case"control":{$=n.width.control;break}case"latin":{$=n.width.regular;break}case"wide":{$=n.width.wide;break}case"zero":{$=0;break}default:switch(pe(I)){case"ambiguous":{$=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{$=n.width.fullWidth;break}case"wide":{$=n.width.wide;break}default:$=n.width.regular}}if(s+$>i&&(c=Math.min(c,a),s+$>n.truncation.limit)){u=!0;break}s+=$,a+=I>65535?2:1}let f=s,me=!1;return u&&n.truncation.limit>=n.truncation.ellipsisWidth&&(f=n.truncation.limit,me=!0),{ellipsed:me,index:u?c:r,truncated:u,width:f}},"C"),Nn=h((e,t={})=>de(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"_1"),qe=80,Ge=24,he=h((e,t,{shell:n,env:i}={})=>Zt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:i}).trim(),"B"),G=h((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"M"),He=h((e,t)=>{const{columns:n,rows:i}=G(e,t);if(!(Number.isNaN(n)||Number.isNaN(i))&&!(n===qe&&i===Ge))return{columns:n,rows:i}},"K"),On=h(()=>{if(x.platform!=="linux")return!0;try{const e=C.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),i=Number.parseInt(n[2],10),r=Number.parseInt(n[5],10);return Number.isNaN(i)||Number.isNaN(r)||r<=0?!1:i===r}catch{return!1}},"R1");function ze(){const{env:e,stdout:t,stderr:n}=x;if(t?.columns&&t?.rows)return G(t.columns,t.rows);if(n?.columns&&n?.rows)return G(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return G(e.COLUMNS,e.LINES);const i={columns:qe,rows:Ge};return x.platform==="win32"?ie()??i:x.platform==="darwin"?Ie()??ie()??i:Ie()??ie()??An()??i}m(ze,"Tt");h(ze,"S1");const Ie=h(()=>{try{const e=x.platform==="darwin"?C.constants.O_EVTONLY|C.constants.O_NONBLOCK:C.constants.O_NONBLOCK,{columns:t,rows:n}=Qt.WriteStream(C.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},"H"),ie=h(()=>{try{const e=he("tput",["cols"],{env:{TERM:"dumb",...x.env}}),t=he("tput",["lines"],{env:{TERM:"dumb",...x.env}});if(e&&t)return He(e,t)}catch{}},"T"),An=h(()=>{try{if(!On())return;const e=he("resize",["-u"]).match(/\d+/g);if(e.length===2)return He(e[0],e[1])}catch{}},"k1"),k=new Map,Sn=500,b=h(e=>{if(!e||e==="")return"";const t=k.get(e);if(t!==void 0)return t;const n=Yt(Object.assign([],{raw:[e]}));if(k.size>=Sn){const i=k.keys().next().value;i!==void 0&&k.delete(i)}return k.set(e,n),n},"u"),H=h(()=>{const e=it().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"_");let De=class{static{m(this,"G")}static{h(this,"U")}lines;constructor(){this.lines=[]}add(e){this.lines.push(e)}toString(){return this.lines.join(Xt.EOL)}header(e){this.add(tt(e)),this.lines.push("")}};const jn=h(e=>e!==void 0&&e>0?e:ze().columns,"L1"),xn=h((e,t,n,i)=>{if(e.length===0||e.some(u=>u.length!==2))return;let r=0;for(const u of e){const d=u[0];if(d===void 0)continue;const f=Nn(d);f>r&&(r=f)}if(r===0)return;const o=n+i,a=r+o,s=20+o;if(a+s>t)return;const c=t-a;return[a,c]},"T1");class En extends De{static{m(this,"Ft")}static{h(this,"C1")}constructor(t){if(super(),t.header&&this.header(b(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(n=>typeof n=="string"))t.content.forEach(n=>{Array.isArray(n)?n.forEach(i=>{this.add(b(i))}):this.add(b(n))});else if(typeof t.content=="string")this.add(b(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const n=U({showHeader:!1,style:{border:V,paddingLeft:4,paddingRight:1},terminalWidth:H(),truncateOverflow:!1,wordWrap:!0});return n.addRow([b(t)]),n.toString()}if(Array.isArray(t)&&t.every(n=>typeof n=="string"||Array.isArray(n)&&n.every(i=>typeof i=="string"))){const n=jn(H()),i=h(s=>Array.isArray(s)?s.map(c=>b(c)):[b(s)],"t"),r=t.map(s=>i(s)),o=xn(r,n,4,1),a=U({columnWidths:o,showHeader:!1,style:{border:V,paddingLeft:4,paddingRight:1},terminalWidth:n,truncateOverflow:!1,wordWrap:!0});return r.forEach(s=>{o!==void 0&&s.length===2?a.addRow([{content:s[0],wordWrap:!1},s[1]]):a.addRow(s)}),a.toString()}if(typeof t=="object"){const n=t;if(!n.options||!n.data)throw new Error(`Must have an "options" or "data" property
4
+ ${JSON.stringify(t)}`);const i=U({showHeader:!1,style:{border:V,paddingLeft:4,paddingRight:1},terminalWidth:H(),truncateOverflow:!1,wordWrap:!0});return n.data.forEach(r=>{Array.isArray(r)?i.addRow(r.map(o=>b(o))):i.addRow([b(r)])}),i.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
5
5
 
6
- ${JSON.stringify(t)}`)}}var mn=Object.defineProperty,bn=g((e,t)=>mn(e,"name",{value:t,configurable:!0}),"m");class yn extends st{static{m(this,"$i")}static{N(this,"Ir")}static{g(this,"O")}static{bn(this,"OptionListSection")}constructor(t){super();let r=t.optionList??[];const n=Array.isArray(t.hide)?t.hide:[t.hide].filter(o=>typeof o=="string"),i=Array.isArray(t.group)?t.group:[t.group].filter(o=>typeof o=="string");n.length>0&&(r=r.filter(o=>!n.includes(o.name))),t.header&&this.header(b(t.header)),i.length>0&&(r=r.filter(o=>{const s=o,u=i.includes("_none")&&!s.group,c=s.group,d=this.intersect(Array.isArray(c)?c:[c],i);return u||d?o:void 0}));const a=J({showHeader:!1,style:{border:Z,paddingLeft:2,paddingRight:1,...t.tableOptions?.style},terminalWidth:X()??t.tableOptions?.terminalWidth,truncateOverflow:!1,wordWrap:t.tableOptions?.wordWrap??!0,...t.tableOptions});r.forEach(o=>{const s=o;a.addRow([this.getOptionNames(s,t.reverseNameOrder??!1,t.isArgument??!1),b(s.description)])}),this.add(a.toString()),this.lines.push("")}getOptionNames(t,r,n){if(!t.name)throw new TypeError("Invalid option definition, name is required.");let i=t.type?t.type.name.toLowerCase():"string";const a=t.multiple||t.lazyMultiple?"[]":"";i=b(t.typeLabel??`{underline ${i}${a}}`);let o;if(t.alias)if(t.name){const s=n?t.name:`{yellow --${t.name}}`;o=b(r?`{bold ${s}}, {bold -${t.alias}} ${i}`:`{bold -${t.alias}}, {bold ${s}} ${i}`)}else r?o=b(`{bold -${t.alias}} ${i}`):o=b(`{bold -${t.alias}} ${i}`);else o=b(`{bold ${n?t.name:`{yellow --${t.name}}`}} ${i}`);return o}intersect(t,r){return t.some(n=>r.includes(n))}}var wn=Object.defineProperty,$n=g((e,t)=>wn(e,"name",{value:t,configurable:!0}),"o");const Ie=$n(e=>(Array.isArray(e)?e:[e]).length===0?"":`
7
- ${e.map(t=>t.optionList?new yn(t).toString():new gn(t).toString()).join(`
8
- `)}`,"commandLineUsage");var vn=Object.defineProperty,lt=m((e,t)=>vn(e,"name",{value:t,configurable:!0}),"b"),On=Object.defineProperty,ut=lt((e,t)=>On(e,"name",{value:t,configurable:!0}),"b");const Nn=[{defaultValue:"32",description:"Controls the verbosity level of output. Valid values: '16' (quiet), '32' (normal), '64' (verbose), '128' (debug)",name:"CEREBRO_OUTPUT_LEVEL",type:String},{description:"Sets the minimum required Node.js version. Overrides the default minimum version check",name:"CEREBRO_MIN_NODE_VERSION",type:Number},{defaultValue:!1,description:"When set, disables the update notifier check",name:"NO_UPDATE_NOTIFIER",type:Boolean},{description:"Standard Node.js environment variable. When set to 'test', disables update notifier",name:"NODE_ENV",type:String},{defaultValue:!1,description:"When set, enables debug output (same as --debug flag)",name:"DEBUG",type:Boolean},{description:"Sets the terminal width for table rendering. Useful for testing and consistent output",name:"CEREBRO_TERMINAL_WIDTH",type:Number}];var jn=Object.defineProperty,I=ut((e,t)=>jn(e,"name",{value:t,configurable:!0}),"f");const qe="__Other",ze=I(e=>e.charAt(0).toUpperCase()+e.slice(1),"upperFirstChar"),An=I((e,t,r,n)=>{e.debug("no command given, printing general help...");let i=[...new Set(r.values())].filter(s=>!s.hidden);n&&(i=i.filter(s=>s.group===n));const a=i.reduce((s,u)=>{const c=u.group??qe;return s[c]??=[],s[c].push(u),s},{}),o=I(s=>s.map(u=>{let c="";typeof u.alias=="string"?c=u.alias:Array.isArray(u.alias)&&(c=u.alias.join(", ")),c!==""&&(c=` [${c}]`);let d=u.name;return u.commandPath&&u.commandPath.length>0&&(d=`${u.commandPath.join(" ")} ${u.name}`),[`${O(d)}${c}`,u.description??""]}),"buildCommandList");(e.raw??e.log)(Ie([{content:`${T(t.getCliName())} ${O("<command>")} [positional arguments] ${ee("[options]")}`,header:y.cyan(" Usage ")},...Object.keys(a).map(s=>{const u=n?` ${ze(n)}`:"";return{content:o(a[s]),header:s===qe||n?y.green(` Available${u} Commands `):` ${y.green(` ${ze(s)} `)}`}}),r.has("help")?{header:y.yellow(" Command Options "),optionList:r.get("help").options?.filter(s=>!s.hidden)}:void 0,{header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:Nn.filter(s=>!s.hidden).map(s=>[s.name,s.description??""]),header:y.magenta(" Environment Variables ")},{content:`Run "${T(t.getCliName())} ${O("help <command>")}" or "${T(t.getCliName())} ${O("<command>")} ${ee("--help")}" for help with a specific command.`,raw:!0}].filter(Boolean)))},"printGeneralHelp"),De=I((e,t)=>{const r=[];for(const n of e.values()){if(n.hidden)continue;const i=n.commandPath??[];if(i.length!==t.length)continue;let a=!0;for(const[o,s]of t.entries())if(i[o]!==s){a=!1;break}a&&r.push(n)}return r},"findChildren"),Pn=I((e,t,r,n)=>{const i=r.join(" "),a=[{content:`${T(t.getCliName())} ${O(i)} ${O("<subcommand>")} [positional arguments] ${ee("[options]")}`,header:y.cyan(" Usage ")},{content:n.map(o=>{const s=[...o.commandPath??[],o.name].join(" ");return[O(s),o.description??""]}),header:y.green(" Subcommands ")},{header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:`Run "${T(t.getCliName())} ${O(`${i} <subcommand>`)} ${ee("--help")}" for help with a specific subcommand.`,raw:!0}];(e.raw??e.log)(Ie(a))},"printParentHelp"),Sn=I((e,t,r,n,i)=>{let a=i??r.get(n);if(!a)for(const d of r.values()){const f=d.commandPath?[...d.commandPath,d.name]:[d.name];if(f.at(-1)===n||f.join(" ")===n){a=d;break}}if(!a){const d=n.split(" ").filter(Boolean),f=d.length>0?De(r,d):[];if(f.length>0){Pn(e,t,d,f);return}e.error(`Command "${n}" not found`);return}const o=[],s=(a.commandPath?[...a.commandPath,a.name]:[a.name]).join(" ");if(o.push({content:`${T(t.getCliName())} ${O(s)}${a.argument?" [positional arguments]":""}${a.options?" [options]":""}`,header:y.cyan(" Usage ")}),a.description&&o.push({content:a.description,header:y.green(" Description ")}),a.argument&&o.push({header:"Command Positional Arguments",isArgument:!0,optionList:[a.argument]}),Array.isArray(a.options)&&a.options.length>0&&o.push({header:y.yellow(" Command Options "),optionList:a.options.filter(d=>!d.hidden)}),o.push({header:y.yellow(" Global Options "),optionList:t.getGlobalOptions()}),Array.isArray(a.env)&&a.env.length>0){const d=a.env.filter(f=>!f.hidden);d.length>0&&o.push({content:d.map(f=>[f.name,f.description??""]),header:y.magenta(" Environment Variables ")})}if(a.alias!==void 0&&a.alias.length>0){let d=a.alias;typeof a.alias=="string"&&(d=[a.alias]),o.splice(1,0,{content:d,header:"Alias(es)"})}Array.isArray(a.examples)&&a.examples.length>0&&o.push({content:a.examples,header:"Examples"});const u=[...a.commandPath??[],a.name],c=De(r,u);c.length>0&&o.push({content:c.map(d=>{const f=[...d.commandPath??[],d.name].join(" ");return[O(f),d.description??""]}),header:y.green(" Subcommands ")}),(e.raw??e.log)(Ie(o))},"printCommandHelp");class Bn{static{m(this,"L")}static{lt(this,"L")}static{ut(this,"x")}static{I(this,"HelpCommand")}argument={description:"Command to show help for (subcommand path supported, e.g. `cli help docker build`)",name:"command",type:String};name="help";options=[{description:"Display only the specified group",name:"group",type:String}];commands;constructor(t){this.commands=t}execute(t){const{argument:r,command:n,commandName:i,logger:a,options:o,runtime:s}=t,{footer:u,header:c}=s.getCommandSection();c&&(a.raw??a.log)(b(c));const d=i==="help"&&Array.isArray(r)&&r.length>0?r.join(" "):void 0;if(i==="help"&&d===void 0)An(a,s,this.commands,typeof o?.group=="string"?o.group:void 0);else{const f=d!==void 0||n===void 0||n.name==="help"?void 0:n;Sn(a,s,this.commands,d??i,f)}u&&(a.raw??a.log)(b(u))}}export{Bn as default};
6
+ ${JSON.stringify(t)}`)}}class In extends De{static{m(this,"zt")}static{h(this,"B1")}constructor(t){super();let n=t.optionList??[];const i=Array.isArray(t.hide)?t.hide:[t.hide].filter(a=>typeof a=="string"),r=Array.isArray(t.group)?t.group:[t.group].filter(a=>typeof a=="string");i.length>0&&(n=n.filter(a=>!i.includes(a.name))),t.header&&this.header(b(t.header)),r.length>0&&(n=n.filter(a=>{const s=a,c=r.includes("_none")&&!s.group,u=s.group,d=this.intersect(Array.isArray(u)?u:[u],r);return c||d?a:void 0}));const o=U({showHeader:!1,style:{border:V,paddingLeft:2,paddingRight:1,...t.tableOptions?.style},terminalWidth:H()??t.tableOptions?.terminalWidth,truncateOverflow:!1,wordWrap:t.tableOptions?.wordWrap??!0,...t.tableOptions});n.forEach(a=>{const s=a;o.addRow([this.getOptionNames(s,t.reverseNameOrder??!1,t.isArgument??!1),b(s.description)])}),this.add(o.toString()),this.lines.push("")}getOptionNames(t,n,i){if(!t.name)throw new TypeError("Invalid option definition, name is required.");let r=t.type?t.type.name.toLowerCase():"string";const o=t.multiple||t.lazyMultiple?"[]":"";r=b(t.typeLabel??`{underline ${r}${o}}`);let a;if(t.alias)if(t.name){const s=i?t.name:`{yellow --${t.name}}`;a=b(n?`{bold ${s}}, {bold -${t.alias}} ${r}`:`{bold -${t.alias}}, {bold ${s}} ${r}`)}else n?a=b(`{bold -${t.alias}} ${r}`):a=b(`{bold -${t.alias}} ${r}`);else a=b(`{bold ${i?t.name:`{yellow --${t.name}}`}} ${r}`);return a}intersect(t,n){return t.some(i=>n.includes(i))}}const ge=h(e=>(Array.isArray(e)?e:[e]).length===0?"":`
7
+ ${e.map(t=>t.optionList?new In(t).toString():new En(t).toString()).join(`
8
+ `)}`,"J1");var Bn=Object.defineProperty,E=m((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"u");const Wn=[{defaultValue:"32",description:"Controls the verbosity level of output. Valid values: '16' (quiet), '32' (normal), '64' (verbose), '128' (debug)",name:"CEREBRO_OUTPUT_LEVEL",type:String},{description:"Sets the minimum required Node.js version. Overrides the default minimum version check",name:"CEREBRO_MIN_NODE_VERSION",type:Number},{defaultValue:!1,description:"When set, disables the update notifier check",name:"NO_UPDATE_NOTIFIER",type:Boolean},{description:"Standard Node.js environment variable. When set to 'test', disables update notifier",name:"NODE_ENV",type:String},{defaultValue:!1,description:"When set, enables debug output (same as --debug flag)",name:"DEBUG",type:Boolean},{description:"Sets the terminal width for table rendering. Useful for testing and consistent output",name:"CEREBRO_TERMINAL_WIDTH",type:Number}],Be="__Other",We=E(e=>e.charAt(0).toUpperCase()+e.slice(1),"v"),Pn=E((e,t,n,i)=>{e.debug("no command given, printing general help...");let r=[...new Set(n.values())].filter(s=>!s.hidden);i&&(r=r.filter(s=>s.group===i));const o=r.reduce((s,c)=>{const u=c.group??Be;return s[u]??=[],s[u].push(c),s},{}),a=E(s=>s.map(c=>{let u="";typeof c.alias=="string"?u=c.alias:Array.isArray(c.alias)&&(u=c.alias.join(", ")),u!==""&&(u=` [${u}]`);let d=c.name;return c.commandPath&&c.commandPath.length>0&&(d=`${c.commandPath.join(" ")} ${c.name}`),[`${N(d)}${u}`,c.description??""]}),"a");(e.raw??e.log)(ge([{content:`${W(t.getCliName())} ${N("<command>")} [positional arguments] ${z("[options]")}`,header:w.cyan(" Usage ")},...Object.keys(o).map(s=>{const c=i?` ${We(i)}`:"";return{content:a(o[s]),header:s===Be||i?w.green(` Available${c} Commands `):` ${w.green(` ${We(s)} `)}`}}),n.has("help")?{header:w.yellow(" Command Options "),optionList:n.get("help").options?.filter(s=>!s.hidden)}:void 0,{header:w.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:Wn.filter(s=>!s.hidden).map(s=>[s.name,s.description??""]),header:w.magenta(" Environment Variables ")},{content:`Run "${W(t.getCliName())} ${N("help <command>")}" or "${W(t.getCliName())} ${N("<command>")} ${z("--help")}" for help with a specific command.`,raw:!0}].filter(Boolean)))},"w"),Pe=E((e,t)=>{const n=[];for(const i of e.values()){if(i.hidden)continue;const r=i.commandPath??[];if(r.length!==t.length)continue;let o=!0;for(const[a,s]of t.entries())if(r[a]!==s){o=!1;break}o&&n.push(i)}return n},"$"),Mn=E((e,t,n,i)=>{const r=n.join(" "),o=[{content:`${W(t.getCliName())} ${N(r)} ${N("<subcommand>")} [positional arguments] ${z("[options]")}`,header:w.cyan(" Usage ")},{content:i.map(a=>{const s=[...a.commandPath??[],a.name].join(" ");return[N(s),a.description??""]}),header:w.green(" Subcommands ")},{header:w.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:`Run "${W(t.getCliName())} ${N(`${r} <subcommand>`)} ${z("--help")}" for help with a specific subcommand.`,raw:!0}];(e.raw??e.log)(ge(o))},"E"),Rn=E((e,t,n,i,r)=>{let o=r??n.get(i);if(!o)for(const d of n.values()){const f=d.commandPath?[...d.commandPath,d.name]:[d.name];if(f.at(-1)===i||f.join(" ")===i){o=d;break}}if(!o){const d=i.split(" ").filter(Boolean),f=d.length>0?Pe(n,d):[];if(f.length>0){Mn(e,t,d,f);return}e.error(`Command "${i}" not found`);return}const a=[],s=(o.commandPath?[...o.commandPath,o.name]:[o.name]).join(" ");if(a.push({content:`${W(t.getCliName())} ${N(s)}${o.argument?" [positional arguments]":""}${o.options?" [options]":""}`,header:w.cyan(" Usage ")}),o.description&&a.push({content:o.description,header:w.green(" Description ")}),o.argument&&a.push({header:"Command Positional Arguments",isArgument:!0,optionList:[o.argument]}),Array.isArray(o.options)&&o.options.length>0&&a.push({header:w.yellow(" Command Options "),optionList:o.options.filter(d=>!d.hidden)}),a.push({header:w.yellow(" Global Options "),optionList:t.getGlobalOptions()}),Array.isArray(o.env)&&o.env.length>0){const d=o.env.filter(f=>!f.hidden);d.length>0&&a.push({content:d.map(f=>[f.name,f.description??""]),header:w.magenta(" Environment Variables ")})}if(o.alias!==void 0&&o.alias.length>0){let d=o.alias;typeof o.alias=="string"&&(d=[o.alias]),a.splice(1,0,{content:d,header:"Alias(es)"})}Array.isArray(o.examples)&&o.examples.length>0&&a.push({content:o.examples,header:"Examples"});const c=[...o.commandPath??[],o.name],u=Pe(n,c);u.length>0&&a.push({content:u.map(d=>{const f=[...d.commandPath??[],d.name].join(" ");return[N(f),d.description??""]}),header:w.green(" Subcommands ")}),(e.raw??e.log)(ge(a))},"N");class Ln{static{m(this,"P")}static{E(this,"P")}argument={description:"Command to show help for (subcommand path supported, e.g. `cli help docker build`)",name:"command",type:String};name="help";options=[{description:"Display only the specified group",name:"group",type:String}];commands;constructor(t){this.commands=t}execute(t){const{argument:n,command:i,commandName:r,logger:o,options:a,runtime:s}=t,{footer:c,header:u}=s.getCommandSection();u&&(o.raw??o.log)(b(u));const d=r==="help"&&Array.isArray(n)&&n.length>0?n.join(" "):void 0;if(r==="help"&&d===void 0)Pn(o,s,this.commands,typeof a?.group=="string"?a.group:void 0);else{const f=d!==void 0||i===void 0||i.name==="help"?void 0:i;Rn(o,s,this.commands,d??r,f)}c&&(o.raw??o.log)(b(c))}}export{Ln as default};
@@ -1,7 +1,7 @@
1
- var We=Object.defineProperty;var C=(e,t)=>We(e,"name",{value:t,configurable:!0});import{createRequire as Se}from"node:module";import{bc as Te,bd as ze,be as _,bf as S,bg as W,bh as T,bi as k,bj as D,bk as re,bl as Ie,bm as ne,bn as Re,bo as ae,bp as se,bq as ie,br as Me,bs as Fe,bt as Ne,bu as Be,bv as qe,bw as Ge,bx as Qe,by as Ve,bz as De,bA as Ke,bB as Je,bC as Ye,bD as He,bE as Xe,bF as Ze,bG as et,bH as oe,r as tt,an as rt,p as nt,b0 as at}from"./bin.js";import{z as pe,M as he,$ as N}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";const _e=Se(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ue=C(e=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[t,r]=I.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return I.getBuiltinModule(e)}return _e(e)},"__cjs_getBuiltinModule"),{createRequire:st}=Ue("node:module");var it=Object.defineProperty,ot=C((e,t)=>it(e,"name",{value:t,configurable:!0}),"r$6"),lt=Object.defineProperty,ct=ot((e,t)=>lt(e,"name",{value:t,configurable:!0}),"a"),ut=Object.defineProperty,ft=ct((e,t)=>ut(e,"name",{value:t,configurable:!0}),"s");const pt=ft((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var ht=Object.defineProperty,mt=C((e,t)=>ht(e,"name",{value:t,configurable:!0}),"T$1"),dt=Object.defineProperty,q=mt((e,t)=>dt(e,"name",{value:t,configurable:!0}),"j");const gt=st(import.meta.url),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bt=q(e=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[t,r]=R.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return R.getBuiltinModule(e)}return gt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:yt}=bt("node:util");var $t=Object.defineProperty,vt=q((e,t)=>$t(e,"name",{value:t,configurable:!0}),"a");const K=new _(1e3),wt=/[.*+?^${}()|[\]\\]/g,jt=vt(e=>{const t=e.join("");if(K.has(t)){const a=K.get(t);return a.lastIndex=0,a}const r=e.map(a=>a.replaceAll(wt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return K.set(t,n),n},"getSeparatorsRegex");var Ct=Object.defineProperty,kt=q((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"t");const Ot=kt(e=>{const t=[];let r=0,n;for(W.lastIndex=0;(n=W.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=W.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var At=Object.defineProperty,$=q((e,t)=>At(e,"name",{value:t,configurable:!0}),"u");const xt=/[ČŠŽĐ]/i,me=new Uint8Array(128),de=new Uint8Array(128),ge=new Uint8Array(128);for(let e=0;e<128;e++)me[e]=e>=65&&e<=90?1:0,de[e]=e>=97&&e<=122?1:0,ge[e]=e>=48&&e<=57?1:0;const J=$(e=>me[e],"isUpper"),le=$(e=>de[e],"isLower"),Y=$(e=>ge[e],"isDigit"),L=$((e,t,r,n,a)=>{if(e.length===0)return[];let s=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){s=!0;break}if(!s&&!r)return[e];const o=[...e],h=[];let i=o[0],p="other";const m=Object.entries(t);for(const u of m){const[f,g]=u;if(g(o[0])){p=f;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const f=o[u];let g="other";for(const y of m){const[v,j]=y;if(j(f)){g=v;break}}const b=r&&n?f===f.toLocaleUpperCase(n):!1;let d=!1;a?d=a(p,g,c,b,f,u,o):(p!==g&&p!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&b&&(d=!0)),d?(h.push(i),i=f):i+=f,p=g,r&&(c=b)}return i&&i.length>0&&h.push(i),h.length>0?h:[e]},"handleScriptTransitions"),Pt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),be=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let s=1;s<a;s++){const l=Pt(e,r,t,n);if(l!==r){r=l,s=r-1;continue}const o=e.codePointAt(s-1),h=e.codePointAt(s),i=o&&o<128&&J(o),p=h&&h<128&&J(h),m=o&&o<128&&le(o),c=o&&o<128&&Y(o),u=h&&h<128&&Y(h);if(m&&p){n.push(e.slice(r,s)),r=s;continue}if(c&&!u||!c&&u){n.push(e.slice(r,s)),r=s;continue}if(u&&!c){let f=!1,g=!1;if(s+1<a){const b=e.codePointAt(s+1);f=b&&b<128&&J(b),g=b&&b<128&&Y(b)}if(!g&&f){n.push(e.slice(r,s),e.slice(s,s+1)),r=s+1;continue}}if(s+1<a){const f=e.codePointAt(s+1),g=f&&f<128&&le(f);if(i&&p&&g){const b=e.slice(r,s+1);t.has(b)||(n.push(e.slice(r,s)),r=s)}}}return r<a&&n.push(e.slice(r)),n.filter(s=>s!=="")},"splitCamelCaseFast"),ye=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const i=[...e],p=i.length,m=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(t),f=u,g=u?0:-1;for(let b=1;b<p;b++){const d=i[b],y=d===d.toLocaleUpperCase(t);if(y===u)c+=d;else if(y)c&&c.length>0&&(m.push(c),c=d),f=!0,g=b;else{if(f&&b-g>1){const v=i[b-1],j=c.slice(0,-1);j&&j.length>0&&m.push(j),c=v+d}else c+=d;f=!1,g=-1}u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!T.test(e)&&!k.test(e))return[e];const i=[...e],p=i.length,m=[];let c=i[0];const u=i[0];let f;T.test(u)?f=1:k.test(u)?f=2:f=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<p;d++){const y=i[d];let v;T.test(y)?v=1:k.test(y)?v=2:v=0;const j=y===y.toLocaleUpperCase(t);f!==v&&(f===1||f===2)&&(v===1||v===2)||v===f&&!g&&j?(m.push(c),c=y):c+=y,f=v,g=j}c&&c.length>0&&m.push(c);const b=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&k.test(m[d])&&T.test(m[d+1][0])?(b.push(m[d]+m[d+1]),d+=1):b.push(m[d]);return b}if(t.startsWith("el")){if(!D.test(e)&&!k.test(e))return[e];const i=[];re.lastIndex=0;let p;for(;(p=re.exec(e))!==null;)i.push(p[0]);i.length===0&&i.push(e);const m=[];if(i.length===1){const c=i[0];if(!c||!D.test(c[0])||c.length===1)return[c??e]}for(const c of i){if(!c)continue;if(!D.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let f=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let b=1;b<u;b++){const d=c[b],y=d===d.toLocaleUpperCase(t);!g&&y?(m.push(f),f=d):f+=d,g=y}f&&m.push(f)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const i=t.startsWith("ja"),p=i?{hiragana:$(c=>Re.test(c),"hiragana"),kanji:$(c=>ne.test(c),"kanji"),katakana:$(c=>Ie.test(c),"katakana"),latin:$(c=>k.test(c),"latin")}:{hangul:$(c=>ae.test(c),"hangul"),latin:$(c=>k.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(i){const c=L(e,p,!1,t,(f,g)=>f==="hiragana"&&g==="katakana"||f==="katakana"&&g==="hiragana"||f==="hiragana"&&g==="latin"||f==="katakana"&&g==="latin"||f==="kanji"&&g==="latin"||f==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const f of c){const g=f;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return L(e,p,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const i=[...e],p=i.length,m=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(t);for(let f=1;f<p;f++){const g=i[f],b=g===g.toLocaleUpperCase(t),d=xt.test(g),y=f<p-1&&i[f+1]===i[f+1].toLocaleUpperCase(t);!u&&b||d&&y?(m.push(c),c=g,d&&y&&(m.push(c),c="")):c+=g,u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return L(e,{han:$(i=>ne.test(i),"han"),latin:$(i=>k.test(i),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const i=$(p=>se.test(p)||ie.test(p),"isRtlChar");return L(e,{latin:$(p=>k.test(p),"latin"),rtl:$(p=>i(p),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const i=$(p=>Me.test(p)||Fe.test(p)||Ne.test(p)||Be.test(p)||qe.test(p)||Ge.test(p)||Qe.test(p)||Ve.test(p)||De.test(p)||Ke.test(p)||Je.test(p)||Ye.test(p)||He.test(p)||Xe.test(p)||Ze.test(p)||et.test(p),"isIndicChar");return L(e,{indic:$(p=>i(p),"indic"),latin:$(p=>k.test(p),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return L(e,{cyrillic:$(i=>T.test(i),"cyrillic"),latin:$(i=>k.test(i),"latin")},!0,t);if(["ar","fa","he"].includes(t))return L(e,{latin:$(i=>k.test(i),"latin"),rtl:$(i=>se.test(i)||ie.test(i),"rtl")},!1,t);if(t.startsWith("ko"))return L(e,{hangul:$(i=>ae.test(i),"hangul"),latin:$(i=>k.test(i),"latin")},!1,t);if(t.startsWith("uz")){if(!T.test(e)&&!k.test(e))return[e];const i=[...e],p=i.length,m=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(t);for(let f=1;f<p;f++){const g=i[f],b=g===g.toLocaleUpperCase(t);if(oe.test(g)||oe.test(i[f-1])){c+=g;continue}!u&&b?(m.push(c),c=g):c+=g,u=b}return c&&c.length>0&&m.push(c),m}const a=[...e],s=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const i of r)if(e.startsWith(i)){l.push(i),o=a[i.length],h=o===o.toLocaleUpperCase(t);break}for(let i=1;i<s;i++){const p=a[i],m=p===p.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,i)){l.push(o,u),c=u.length,o="";const f=u.at(-1);f&&(h=f===f.toLocaleUpperCase(t));break}if(c>0){i+=c-1;continue}!h&&m?(l.push(o),o=p):o+=p,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Et=$((e,t,r)=>{const n=[],a=S.test(e)?e.split(S).filter(Boolean):[e];for(const s of a){const l=s;if(S.test(l))n.push(l);else{W.lastIndex=0;const o=W.test(l)?Ot(l).filter(Boolean):[l];for(const h of o)if(W.lastIndex=0,W.test(h))n.push(h);else if(t){const i=t.toLowerCase().split("-")[0];n.push(...ye(h,i,r))}else n.push(...be(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:s,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:i=!1}=t,p=new Set([...a].toSorted((d,y)=>y.length-d.length));let m=e;h&&(m=yt(m)),i&&(m=Te(m));let c;Array.isArray(o)?c=jt(o):o instanceof RegExp?c=o:c=ze;const u=[];let f=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;f.length>0;){const d=g.exec(f);if(!d){f===".."?u.push(".."):f==="."?u.push("."):f.length>0&&u.push(f);break}const y=d.index,v=d[0],j=v.length,F=f.slice(0,y),Le=f.slice(y+j);if(v.startsWith("../"))u.push(".."),f=f.slice(y+3);else if(v.startsWith("./"))u.push("."),f=f.slice(y+2);else if(y===0&&v==="..")u.push(".."),f=f.slice(2);else if(y===0&&v===".")u.push("."),f=f.slice(1);else{F.length>0&&u.push(F);let P=0;for(;(P=v.indexOf("../",P))!==-1;)u.push(".."),P+=3;for(P=0;(P=v.indexOf("./",P))!==-1;)(P===0||v[P-1]!==".")&&u.push("."),P+=2;let E=Le;for(;E.startsWith("../");)u.push(".."),E=E.slice(3);for(;E.startsWith("./");)u.push("."),E=E.slice(2);if(E===".."){u.push("..");break}else if(E==="."){u.push(".");break}else f=E}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let b=[];for(const d of u)r||n?b.push(...Et(d,s,p)):s?b.push(...ye(d,s,p)):b.push(...be(d,p));return l&&(b=b.map(d=>p.has(d)?d:s&&d===d.toLocaleUpperCase(s)?d[0]+d.slice(1).toLocaleLowerCase(s):d.toUpperCase()===d&&!p.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),b},"splitByCase");var Lt=Object.defineProperty,Wt=C((e,t)=>Lt(e,"name",{value:t,configurable:!0}),"r$5"),St=Object.defineProperty,_t=Wt((e,t)=>St(e,"name",{value:t,configurable:!0}),"o"),Ut=Object.defineProperty,Tt=_t((e,t)=>Ut(e,"name",{value:t,configurable:!0}),"s");const Z=Tt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var zt=Object.defineProperty,It=C((e,t)=>zt(e,"name",{value:t,configurable:!0}),"r$4"),Rt=Object.defineProperty,Mt=It((e,t)=>Rt(e,"name",{value:t,configurable:!0}),"r"),Ft=Object.defineProperty,Nt=Mt((e,t)=>Ft(e,"name",{value:t,configurable:!0}),"n");const Q=Nt((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var Bt=Object.defineProperty,qt=C((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"i$3"),Gt=Object.defineProperty,Qt=qt((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"f"),Vt=Object.defineProperty,Dt=Qt((e,t)=>Vt(e,"name",{value:t,configurable:!0}),"l");const V=Dt((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",s="";for(let l=0;l<r;l++){const o=e[l];if(S.test(o)){a?(n.push(a+s+o),a="",s=""):(n.length>0&&n.push(t),a=o);continue}a?(s&&(s+=t),s+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var Kt=Object.defineProperty,Jt=C((e,t)=>Kt(e,"name",{value:t,configurable:!0}),"r$3"),Yt=Object.defineProperty,Ht=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"a"),Xt=Object.defineProperty,Zt=Ht((e,t)=>Xt(e,"name",{value:t,configurable:!0}),"e");const er=/(?<![a-zß])SS(?![a-z])/g,ee=Zt(e=>e.replaceAll(er,"ß"),"normalizeGermanEszett");var tr=Object.defineProperty,rr=C((e,t)=>tr(e,"name",{value:t,configurable:!0}),"c$3"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"c"),sr=Object.defineProperty,ir=ar((e,t)=>sr(e,"name",{value:t,configurable:!0}),"o");const or=new _(1e3),lr=ir((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??or;let a;if(r&&(a=Q(e,t)),r&&a&&n.has(a))return n.get(a);let s=!0;const l=V(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&S.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,i=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return s?(s=!1,pt(i,t)):Z(i,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var cr=Object.defineProperty,ur=C((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l$3"),fr=Object.defineProperty,pr=ur((e,t)=>fr(e,"name",{value:t,configurable:!0}),"l"),hr=Object.defineProperty,mr=pr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"o");const dr=new _(1e3),te=mr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??dr;let a;if(r&&(a=Q(e,t)),r&&a&&n.has(a))return n.get(a);const s=G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&S.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=V(s,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var gr=Object.defineProperty,br=C((e,t)=>gr(e,"name",{value:t,configurable:!0}),"r$2"),yr=Object.defineProperty,$r=br((e,t)=>yr(e,"name",{value:t,configurable:!0}),"a"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"s");const jr=new _(1e3),Cr=wr((e,t)=>te(e,{cacheStore:jr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var kr=Object.defineProperty,Or=C((e,t)=>kr(e,"name",{value:t,configurable:!0}),"l$2"),Ar=Object.defineProperty,xr=Or((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"l"),Pr=Object.defineProperty,Er=xr((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"i");const Lr=new _(1e3),Wr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Lr;let a;if(r&&(a=Q(e,t)),r&&a&&n.has(a))return n.get(a);const s=V(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&S.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,s),s},"pascalCase");var Sr=Object.defineProperty,_r=C((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"r$1"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Ir=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Rr=new _(1e3),Mr=Ir((e,t)=>te(e,{cacheStore:Rr,...t,joiner:"_"}),"snakeCase");var Fr=Object.defineProperty,Nr=C((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"r"),Br=Object.defineProperty,qr=Nr((e,t)=>Br(e,"name",{value:t,configurable:!0}),"e"),Gr=Object.defineProperty,Qr=qr((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"i");const Vr=new _(1e3),Dr=Qr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Vr;let a;if(r&&(a=Q(e,t)),r&&a&&n.has(a))return n.get(a);const s=V(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,s),s},"trainCase");var Kr=Object.defineProperty,O=C((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"e");const A=O(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),H={camel_case:O(e=>lr(A(e)),"camel_case"),kebab_case:O(e=>te(A(e)),"kebab_case"),lower_case:O(e=>A(e).toLowerCase(),"lower_case"),pascal_case:O(e=>Wr(A(e)),"pascal_case"),path_join:O((e,...t)=>{const r=[A(e),...t.map(n=>A(n))];return he(...r)},"path_join"),path_relative:O((e,t)=>pe(A(t),A(e)),"path_relative"),snake_case:O(e=>Mr(A(e)),"snake_case"),upper_case:O(e=>A(e).toUpperCase(),"upper_case"),upper_kebab_case:O(e=>Dr(A(e)),"upper_kebab_case"),upper_snake_case:O(e=>Cr(A(e)),"upper_snake_case")};O(e=>Object.hasOwn(H,e),"isKnownFilter");const $e=O((e,t,r=[])=>{const n=H[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(H).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var Jr=Object.defineProperty,ve=C((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"d$1");const we=ve(e=>{const t=[];let r=0,n=0,a,s=-1;for(const l of e){if(s+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),Yr=ve(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var Hr=Object.defineProperty,U=C((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"s$1");const Xr=/\[([^\]]+)\]/g,Zr=U(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:we(a).map(s=>{const l=s.trim();return Yr(l)??l}),name:n}},"parseFilterCall"),en=U(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>Zr(n)),name:r}},"parsePipe"),tn=U(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),rn=U((e,t)=>{const r=e.replaceAll(Xr,(n,a)=>{const{filters:s,name:l}=en(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of s)o=$e(h.name,o,h.args);return tn(o)});return je(r)},"interpolateFilename"),je=U(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),nn=U(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),an=U(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var sn=Object.defineProperty,on=C((e,t)=>sn(e,"name",{value:t,configurable:!0}),"i");const ln=on((e,t)=>{if(!e.startsWith(`---
1
+ var We=Object.defineProperty;var k=(e,t)=>We(e,"name",{value:t,configurable:!0});import{createRequire as Ue}from"node:module";import{bc as _,bd as U,be as T,bf as A,bg as G,bh as te,bi as Pe,bj as ne,bk as Te,bl as se,bm as re,bn as ie,bo as ze,bp as Me,bq as Ie,br as Re,bs as Fe,bt as Ne,bu as Be,bv as qe,bw as De,bx as Ve,by as Ge,bz as Qe,bA as Je,bB as Ke,bC as He,bD as Ye,bE as oe,bF as S,bG as Xe,bH as Ze,r as et,an as tt,p as nt,b0 as st}from"./bin.js";import{z as ue,M as pe,B as N}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";const Se=Ue(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=k(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,n]=M.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return M.getBuiltinModule(e)}return Se(e)},"__cjs_getBuiltinModule"),{createRequire:rt}=_e("node:module");var it=Object.defineProperty,ot=k((e,t)=>it(e,"name",{value:t,configurable:!0}),"e$2");const at=ot((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"a");var lt=Object.defineProperty,y=k((e,t)=>lt(e,"name",{value:t,configurable:!0}),"g");const ct=rt(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=y(e=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[t,n]=I.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return I.getBuiltinModule(e)}return ct(e)},"V"),{stripVTControlCharacters:ut}=ft("node:util"),Q=new _(1e3),pt=/[.*+?^${}()|[\]\\]/g,ht=y(e=>{const t=e.join("");if(Q.has(t)){const r=Q.get(t);return r.lastIndex=0,r}const n=e.map(r=>r.replaceAll(pt,String.raw`\$&`)).join("|"),s=new RegExp(n,"g");return Q.set(t,s),s},"Le"),mt=y(e=>{const t=[];let n=0,s;for(U.lastIndex=0;(s=U.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(s[0]),n=U.lastIndex;return n<e.length&&t.push(e.slice(n)),t.filter(Boolean)},"Ce"),dt=/[ČŠŽĐ]/i,he=new Uint8Array(128),me=new Uint8Array(128),de=new Uint8Array(128);for(let e=0;e<128;e++)he[e]=e>=65&&e<=90?1:0,me[e]=e>=97&&e<=122?1:0,de[e]=e>=48&&e<=57?1:0;const J=y(e=>he[e],"j"),ae=y(e=>me[e],"O"),K=y(e=>de[e],"w"),W=y((e,t,n,s,r)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const f of l)if(f(e[0])){i=!0;break}if(!i&&!n)return[e];const a=[...e],h=[];let o=a[0],p="other";const m=Object.entries(t);for(const f of m){const[u,g]=f;if(g(a[0])){p=u;break}}let c=n&&s?a[0]===a[0].toLocaleUpperCase(s):!1;for(let f=1;f<a.length;f++){const u=a[f];let g="other";for(const $ of m){const[v,j]=$;if(j(u)){g=v;break}}const b=n&&s?u===u.toLocaleUpperCase(s):!1;let d=!1;r?d=r(p,g,c,b,u,f,a):(p!==g&&p!=="other"&&g!=="other"&&(d=!0),n&&g!=="other"&&!c&&b&&(d=!0)),d?(h.push(o),o=u):o+=u,p=g,n&&(c=b)}return o&&o.length>0&&h.push(o),h.length>0?h:[e]},"k"),gt=y((e,t,n,s)=>{if(n.size===0)return t;for(const r of n)if(e.startsWith(r,t))return s.push(r),t+r.length;return t},"Ue"),ge=y((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let n=0;const s=[],r=e.length;for(let i=1;i<r;i++){const l=gt(e,n,t,s);if(l!==n){n=l,i=n-1;continue}const a=e.codePointAt(i-1),h=e.codePointAt(i),o=a&&a<128&&J(a),p=h&&h<128&&J(h),m=a&&a<128&&ae(a),c=a&&a<128&&K(a),f=h&&h<128&&K(h);if(m&&p){s.push(e.slice(n,i)),n=i;continue}if(c&&!f||!c&&f){s.push(e.slice(n,i)),n=i;continue}if(f&&!c){let u=!1,g=!1;if(i+1<r){const b=e.codePointAt(i+1);u=b&&b<128&&J(b),g=b&&b<128&&K(b)}if(!g&&u){s.push(e.slice(n,i),e.slice(i,i+1)),n=i+1;continue}}if(i+1<r){const u=e.codePointAt(i+1),g=u&&u<128&&ae(u);if(o&&p&&g){const b=e.slice(n,i+1);t.has(b)||(s.push(e.slice(n,i)),n=i)}}}return n<r&&s.push(e.slice(n)),s.filter(i=>i!=="")},"D"),be=y((e,t,n)=>{if(e.length===0)return[];const s=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!s&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const o=[...e],p=o.length,m=[];let c=o[0],f=o[0]===o[0].toLocaleUpperCase(t),u=f,g=f?0:-1;for(let b=1;b<p;b++){const d=o[b],$=d===d.toLocaleUpperCase(t);if($===f)c+=d;else if($)c&&c.length>0&&(m.push(c),c=d),u=!0,g=b;else{if(u&&b-g>1){const v=o[b-1],j=c.slice(0,-1);j&&j.length>0&&m.push(j),c=v+d}else c+=d;u=!1,g=-1}f=$}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!T.test(e)&&!A.test(e))return[e];const o=[...e],p=o.length,m=[];let c=o[0];const f=o[0];let u;T.test(f)?u=1:A.test(f)?u=2:u=0;let g=f===f.toLocaleUpperCase(t);for(let d=1;d<p;d++){const $=o[d];let v;T.test($)?v=1:A.test($)?v=2:v=0;const j=$===$.toLocaleUpperCase(t);u!==v&&(u===1||u===2)&&(v===1||v===2)||v===u&&!g&&j?(m.push(c),c=$):c+=$,u=v,g=j}c&&c.length>0&&m.push(c);const b=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&A.test(m[d])&&T.test(m[d+1][0])?(b.push(m[d]+m[d+1]),d+=1):b.push(m[d]);return b}if(t.startsWith("el")){if(!G.test(e)&&!A.test(e))return[e];const o=[];te.lastIndex=0;let p;for(;(p=te.exec(e))!==null;)o.push(p[0]);o.length===0&&o.push(e);const m=[];if(o.length===1){const c=o[0];if(!c||!G.test(c[0])||c.length===1)return[c??e]}for(const c of o){if(!c)continue;if(!G.test(c[0])||c.length===1){m.push(c);continue}const f=c.length;let u=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let b=1;b<f;b++){const d=c[b],$=d===d.toLocaleUpperCase(t);!g&&$?(m.push(u),u=d):u+=d,g=$}u&&m.push(u)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const o=t.startsWith("ja"),p=o?{hiragana:y(c=>Te.test(c),"hiragana"),kanji:y(c=>ne.test(c),"kanji"),katakana:y(c=>Pe.test(c),"katakana"),latin:y(c=>A.test(c),"latin")}:{hangul:y(c=>se.test(c),"hangul"),latin:y(c=>A.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(o){const c=W(e,p,!1,t,(u,g)=>u==="hiragana"&&g==="katakana"||u==="katakana"&&g==="hiragana"||u==="hiragana"&&g==="latin"||u==="katakana"&&g==="latin"||u==="kanji"&&g==="latin"||u==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),f=[];for(const u of c){const g=u;g.length===1&&m.has(g)&&f.length>0?f[f.length-1]=f.at(-1)+g:f.push(g)}return f.length>0?f:[e]}return W(e,p,!1,t,(c,f)=>c==="hangul"&&f==="latin"||c==="latin"&&f==="hangul")}if(t.startsWith("sl")){const o=[...e],p=o.length,m=[];let c=o[0],f=o[0]===o[0].toLocaleUpperCase(t);for(let u=1;u<p;u++){const g=o[u],b=g===g.toLocaleUpperCase(t),d=dt.test(g),$=u<p-1&&o[u+1]===o[u+1].toLocaleUpperCase(t);!f&&b||d&&$?(m.push(c),c=g,d&&$&&(m.push(c),c="")):c+=g,f=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return W(e,{han:y(o=>ne.test(o),"han"),latin:y(o=>A.test(o),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const o=y(p=>re.test(p)||ie.test(p),"s");return W(e,{latin:y(p=>A.test(p),"latin"),rtl:y(p=>o(p),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const o=y(p=>ze.test(p)||Me.test(p)||Ie.test(p)||Re.test(p)||Fe.test(p)||Ne.test(p)||Be.test(p)||qe.test(p)||De.test(p)||Ve.test(p)||Ge.test(p)||Qe.test(p)||Je.test(p)||Ke.test(p)||He.test(p)||Ye.test(p),"s");return W(e,{indic:y(p=>o(p),"indic"),latin:y(p=>A.test(p),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return W(e,{cyrillic:y(o=>T.test(o),"cyrillic"),latin:y(o=>A.test(o),"latin")},!0,t);if(["ar","fa","he"].includes(t))return W(e,{latin:y(o=>A.test(o),"latin"),rtl:y(o=>re.test(o)||ie.test(o),"rtl")},!1,t);if(t.startsWith("ko"))return W(e,{hangul:y(o=>se.test(o),"hangul"),latin:y(o=>A.test(o),"latin")},!1,t);if(t.startsWith("uz")){if(!T.test(e)&&!A.test(e))return[e];const o=[...e],p=o.length,m=[];let c=o[0],f=o[0]===o[0].toLocaleUpperCase(t);for(let u=1;u<p;u++){const g=o[u],b=g===g.toLocaleUpperCase(t);if(oe.test(g)||oe.test(o[u-1])){c+=g;continue}!f&&b?(m.push(c),c=g):c+=g,f=b}return c&&c.length>0&&m.push(c),m}const r=[...e],i=r.length,l=[];let a=r[0],h=r[0]===r[0].toLocaleUpperCase(t);for(const o of n)if(e.startsWith(o)){l.push(o),a=r[o.length],h=a===a.toLocaleUpperCase(t);break}for(let o=1;o<i;o++){const p=r[o],m=p===p.toLocaleUpperCase(t);let c=0;for(const f of n)if(e.startsWith(f,o)){l.push(a,f),c=f.length,a="";const u=f.at(-1);u&&(h=u===u.toLocaleUpperCase(t));break}if(c>0){o+=c-1;continue}!h&&m?(l.push(a),a=p):a+=p,h=m}return a&&l.push(a),l},"q"),bt=y((e,t,n)=>{const s=[],r=S.test(e)?e.split(S).filter(Boolean):[e];for(const i of r){const l=i;if(S.test(l))s.push(l);else{U.lastIndex=0;const a=U.test(l)?mt(l).filter(Boolean):[l];for(const h of a)if(U.lastIndex=0,U.test(h))s.push(h);else if(t){const o=t.toLowerCase().split("-")[0];s.push(...be(h,o,n))}else s.push(...ge(h,n))}}return s},"Ie"),q=y((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:n=!1,handleEmoji:s=!1,knownAcronyms:r=[],locale:i,normalize:l=!1,separators:a,stripAnsi:h=!1,stripEmoji:o=!1}=t,p=new Set([...r].toSorted((d,$)=>$.length-d.length));let m=e;h&&(m=ut(m)),o&&(m=Xe(m));let c;Array.isArray(a)?c=ht(a):a instanceof RegExp?c=a:c=Ze;const f=[];let u=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;u.length>0;){const d=g.exec(u);if(!d){u===".."?f.push(".."):u==="."?f.push("."):u.length>0&&f.push(u);break}const $=d.index,v=d[0],j=v.length,F=u.slice(0,$),Oe=u.slice($+j);if(v.startsWith("../"))f.push(".."),u=u.slice($+3);else if(v.startsWith("./"))f.push("."),u=u.slice($+2);else if($===0&&v==="..")f.push(".."),u=u.slice(2);else if($===0&&v===".")f.push("."),u=u.slice(1);else{F.length>0&&f.push(F);let L=0;for(;(L=v.indexOf("../",L))!==-1;)f.push(".."),L+=3;for(L=0;(L=v.indexOf("./",L))!==-1;)(L===0||v[L-1]!==".")&&f.push("."),L+=2;let O=Oe;for(;O.startsWith("../");)f.push(".."),O=O.slice(3);for(;O.startsWith("./");)f.push("."),O=O.slice(2);if(O===".."){f.push("..");break}else if(O==="."){f.push(".");break}else u=O}g.lastIndex=0}if(f.length===0){const d=m.split(c).filter(Boolean);f.push(...d)}let b=[];for(const d of f)n||s?b.push(...bt(d,i,p)):i?b.push(...be(d,i,p)):b.push(...ge(d,p));return l&&(b=b.map(d=>p.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!p.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),b},"be");var yt=Object.defineProperty,$t=k((e,t)=>yt(e,"name",{value:t,configurable:!0}),"l$4");const X=$t((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"a");var vt=Object.defineProperty,wt=k((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r$2");const D=wt((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"r");var jt=Object.defineProperty,kt=k((e,t)=>jt(e,"name",{value:t,configurable:!0}),"p$4");const V=kt((e,t)=>{const{length:n}=e;if(n===0)return"";if(n===1)return e[0];const s=[];let r="",i="";for(let l=0;l<n;l++){const a=e[l];if(S.test(a)){r?(s.push(r+i+a),r="",i=""):(s.length>0&&s.push(t),r=a);continue}r?(i&&(i+=t),i+=a):(s.length>0&&s.push(t),s.push(a))}return s.join("")},"p");var At=Object.defineProperty,Ct=k((e,t)=>At(e,"name",{value:t,configurable:!0}),"e$1");const xt=/(?<![a-zß])SS(?![a-z])/g,Z=Ct(e=>e.replaceAll(xt,"ß"),"l");var Et=Object.defineProperty,Lt=k((e,t)=>Et(e,"name",{value:t,configurable:!0}),"p$2");const Ot=new _(1e3),Wt=Lt((e,t)=>{if(typeof e!="string"||!e)return"";const n=t?.cache??!1,s=t?.cacheStore??Ot;let r;if(n&&(r=D(e,t)),n&&r&&s.has(r))return s.get(r);let i=!0;const l=V(q(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(a=>{if(t?.handleAnsi&&S.test(a))return a;const h=t?.locale?.startsWith("de")?Z(a):a,o=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,at(o,t)):X(o,t)}),"");return n&&r&&s.set(r,l),l},"R");var Ut=Object.defineProperty,St=k((e,t)=>Ut(e,"name",{value:t,configurable:!0}),"l$2");const _t=new _(1e3),ee=St((e,t)=>{if(typeof e!="string")return"";const n=t?.cache??!1,s=t?.cacheStore??_t;let r;if(n&&(r=D(e,t)),n&&r&&s.has(r))return s.get(r);const i=q(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(a=>{if(t?.handleAnsi&&S.test(a))return a;if(t?.toUpperCase)return t.locale?a.toLocaleUpperCase(t.locale):a.toUpperCase();const h=t?.locale?.startsWith("de")?Z(a):a;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=V(i,t?.joiner??"-");return n&&r&&s.set(r,l),l},"L");var Pt=Object.defineProperty,Tt=k((e,t)=>Pt(e,"name",{value:t,configurable:!0}),"r$1");const zt=new _(1e3),Mt=Tt((e,t)=>ee(e,{cacheStore:zt,...t,joiner:"_",toUpperCase:!0}),"m");var It=Object.defineProperty,Rt=k((e,t)=>It(e,"name",{value:t,configurable:!0}),"l$1");const Ft=new _(1e3),Nt=Rt((e,t)=>{if(typeof e!="string"||!e)return"";const n=t?.cache??!1,s=t?.cacheStore??Ft;let r;if(n&&(r=D(e,t)),n&&r&&s.has(r))return s.get(r);const i=V(q(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&S.test(l))return l;const a=t?.locale?.startsWith("de")?Z(l):l;return X(t?.locale?a.toLocaleLowerCase(t.locale):a.toLowerCase(),{locale:t?.locale})}),"");return n&&r&&s.set(r,i),i},"L");var Bt=Object.defineProperty,qt=k((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"r");const Dt=new _(1e3),Vt=qt((e,t)=>ee(e,{cacheStore:Dt,...t,joiner:"_"}),"n");var Gt=Object.defineProperty,Qt=k((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"a$1");const Jt=new _(1e3),Kt=Qt((e,t)=>{if(typeof e!="string")return"";const n=t?.cache??!1,s=t?.cacheStore??Jt;let r;if(n&&(r=D(e,t)),n&&r&&s.has(r))return s.get(r);const i=V(q(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>X(l,{locale:t?.locale})),"-");return n&&r&&s.set(r,i),i},"y");var Ht=Object.defineProperty,C=k((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"e");const x=C(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),H={camel_case:C(e=>Wt(x(e)),"camel_case"),kebab_case:C(e=>ee(x(e)),"kebab_case"),lower_case:C(e=>x(e).toLowerCase(),"lower_case"),pascal_case:C(e=>Nt(x(e)),"pascal_case"),path_join:C((e,...t)=>{const n=[x(e),...t.map(s=>x(s))];return pe(...n)},"path_join"),path_relative:C((e,t)=>ue(x(t),x(e)),"path_relative"),snake_case:C(e=>Vt(x(e)),"snake_case"),upper_case:C(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:C(e=>Kt(x(e)),"upper_kebab_case"),upper_snake_case:C(e=>Mt(x(e)),"upper_snake_case")};C(e=>Object.hasOwn(H,e),"isKnownFilter");const ye=C((e,t,n=[])=>{const s=H[e];if(!s)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(H).sort().join(", ")}.`);return s(t,...n)},"applyFilter");var Yt=Object.defineProperty,$e=k((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"d$1");const ve=$e(e=>{const t=[];let n=0,s=0,r,i=-1;for(const l of e){if(i+=1,r){l===r&&(r=void 0);continue}if(l==='"'||l==="'"){r=l;continue}l==="("?n+=1:l===")"?n-=1:l===","&&n===0&&(t.push(e.slice(s,i)),s=i+1)}return t.push(e.slice(s)),t},"splitCommaOutsideQuotes"),Xt=$e(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var Zt=Object.defineProperty,P=k((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"s$1");const en=/\[([^\]]+)\]/g,tn=P(e=>{const t=e.trim(),n=t.indexOf("(");if(n===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const s=t.slice(0,n).trim(),r=t.slice(n+1,-1).trim();return r===""?{args:[],name:s}:{args:ve(r).map(i=>{const l=i.trim();return Xt(l)??l}),name:s}},"parseFilterCall"),nn=P(e=>{const t=e.split("|").map(s=>s.trim()),n=t[0]??"";if(!n)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(s=>tn(s)),name:n}},"parsePipe"),sn=P(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),rn=P((e,t)=>{const n=e.replaceAll(en,(s,r)=>{const{filters:i,name:l}=nn(r);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let a=t[l];for(const h of i)a=ye(h.name,a,h.args);return sn(a)});return we(n)},"interpolateFilename"),we=P(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),on=P(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),an=P(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var ln=Object.defineProperty,cn=k((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const fn=cn((e,t)=>{if(!e.startsWith(`---
2
2
  `)&&!e.startsWith(`---\r
3
- `))return{body:e};const r=e.indexOf(`
4
- ---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
5
- `&&(n+=1);const a=e.startsWith(`---\r
6
- `)?5:4,s=e.slice(a,r).replaceAll("\r","");let l;try{l=t(s)}catch(o){const h=o instanceof Error?o.message:String(o);throw new Error(`Failed to parse frontmatter YAML: ${h}`,{cause:o})}if(l==null)return{body:e.slice(n)};if(typeof l!="object"||Array.isArray(l))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(l)?"array":typeof l}`);return{body:e.slice(n),frontmatter:l}},"splitFrontmatter");var cn=Object.defineProperty,w=C((e,t)=>cn(e,"name",{value:t,configurable:!0}),"c");const un=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,Ce=w(e=>{const t=[];let r=0,n=1;const a=w(s=>{for(const l of s)l===`
7
- `&&(n+=1)},"advanceLine");for(const s of e.matchAll(un)){const l=s.index??0;if(l>r){const i=e.slice(r,l);t.push({line:n,type:"text",value:i}),a(i)}const o=n,h=s[0];h.startsWith("{{")?t.push({line:o,type:"expr",value:(s[1]??"").trim()}):t.push({line:o,type:"stmt",value:(s[2]??"").trim()}),a(h),r=l+h.length}if(r<e.length){const s=e.slice(r);t.push({line:n,type:"text",value:s})}return t},"tokenize"),fn=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),ke=w((e,t)=>{let r=0;const n=w((s,l)=>{throw new Error(`${t}:${s}: ${l}`)},"error"),a=w(s=>{const l=[];for(;r<e.length;){const o=e[r];if(o.type==="text"){l.push({type:"text",value:o.value}),r+=1;continue}if(o.type==="expr"){l.push({expression:o.value,line:o.line,type:"expr"}),r+=1;continue}const h=o.value.split(/\s+/)[0]??"";if(s.includes(h))return l;if(fn.has(h)&&n(o.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){r+=1;const i=o.value.slice(2).trim(),p=a(["else","endif"]);let m;r<e.length&&e[r].type==="stmt"&&e[r].value.split(/\s+/)[0]==="else"&&(r+=1,m=a(["endif"])),(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endif")&&n(o.line,"Unterminated {% if %} — missing {% endif %}"),r+=1,l.push({alternate:m,condition:i,consequent:p,line:o.line,type:"if"});continue}if(h==="for"){r+=1;const i=o.value.slice(3).trim(),p=i.indexOf(" in ");p===-1&&n(o.line,"Malformed {% for %} — expected `for <name> in <collection>`");const m=i.slice(0,p).trim(),c=i.slice(p+4).trim();(!m||!c)&&n(o.line,"Malformed {% for %} — missing binding or collection");const u=a(["endfor"]);(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endfor")&&n(o.line,"Unterminated {% for %} — missing {% endfor %}"),r+=1,l.push({binding:m,body:u,collection:c,line:o.line,type:"for"});continue}if(h==="include"){r+=1;const i=o.value.slice(7).trim(),p=Oe(i);p===void 0&&n(o.line,"Malformed {% include %} — expected a quoted partial name"),l.push({line:o.line,name:p,type:"include"});continue}n(o.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return l},"parseBlock");return a([])},"parse"),Oe=w(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes"),pn=w(e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),"stringify"),hn=w(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,"isTruthy"),Ae=w((e,t,r,n,a=!0)=>{const s=e.split(".");if(a&&s.length>0&&!Object.hasOwn(t,s[0]))throw new Error(`${n}:${r}: Variable "${e}" is not defined`);let l=t;for(const o of s){if(l==null)return;if(typeof l!="object")throw new TypeError(`${n}:${r}: Cannot read "${o}" on non-object value`);l=l[o]}return l},"lookupVariable"),mn=w(e=>{const t=[];let r=0,n=0,a;for(let s=0;s<e.length;s+=1){const l=e[s];if(a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l==="|"&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},"splitFilterPipe"),dn=w(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a?{args:we(a).map(s=>s.trim()),name:n}:{args:[],name:n}},"parseFilterCall"),B=w((e,t,r,n,a=!0)=>{const s=e.trim();if(s==="true")return!0;if(s==="false")return!1;if(s==="null"||s==="none")return null;const l=Oe(s);return l!==void 0?l:/^-?\d+(?:\.\d+)?$/.test(s)?Number(s):Ae(s,t,r,n,a)},"evaluatePrimary"),xe=w((e,t,r,n,a=!0)=>{const s=mn(e),l=s[0].trim();let o=B(l,t,r,n,a);for(let h=1;h<s.length;h+=1){const i=s[h].trim(),{args:p,name:m}=dn(i),c=p.map(u=>B(u,t,r,n,a));try{o=$e(m,o,c)}catch(u){const f=u instanceof Error?u.message:String(u);throw new Error(`${n}:${r}: ${f}`,{cause:u})}}return o},"evaluateExpression"),Pe=w((e,t)=>{let r,n=0;for(let a=0;a<=e.length-t.length;a+=1){const s=e[a];if(r){s===r&&(r=void 0);continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n+=1;continue}if(s===")"){n-=1;continue}if(n===0&&e.slice(a,a+t.length)===t)return a}return-1},"findOperatorOutsideQuotes"),ce=w((e,t)=>{const r=[];let n=0,a=0;for(;a<=e.length-t.length;){const s=Pe(e.slice(a),t);if(s===-1)break;r.push(e.slice(n,a+s)),a+=s+t.length,n=a}return r.push(e.slice(n)),r},"splitLogical"),z=w((e,t,r,n)=>{const a=e.trim();if(a==="")return!1;if(a.startsWith("(")&&a.endsWith(")")&&gn(a)===a.length-1)return z(a.slice(1,-1),t,r,n);const s=ce(a," or ");if(s.length>1)return s.some(o=>z(o,t,r,n));const l=ce(a," and ");if(l.length>1)return l.every(o=>z(o,t,r,n));if(a.startsWith("not "))return!z(a.slice(4),t,r,n);for(const o of["==","!="]){const h=Pe(a,o);if(h!==-1){const i=B(a.slice(0,h),t,n,r,!1),p=B(a.slice(h+o.length),t,n,r,!1),m=i===p;return o==="=="?m:!m}}return hn(xe(a,t,n,r,!1))},"evaluateConditionExpression"),gn=w(e=>{if(e[0]!=="(")return-1;let t=0,r,n=-1;for(const a of e){if(n+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}if(a==="(")t+=1;else if(a===")"&&(t-=1,t===0))return n}return-1},"matchingParen"),M=w((e,t)=>{let r="";for(const n of e){if(n.type==="text"){r+=n.value;continue}if(n.type==="expr"){r+=pn(xe(n.expression,t.scope,n.line,t.filename));continue}if(n.type==="if"){const a=z(n.condition,t.scope,t.filename,n.line)?n.consequent:n.alternate??[];r+=M(a,t);continue}if(n.type==="for"){const a=Ae(n.collection,t.scope,n.line,t.filename,!1);if(a==null)continue;if(!Array.isArray(a))throw new TypeError(`${t.filename}:${n.line}: {% for %} expected an array, got ${typeof a}`);for(const s of a){const l={...t.scope,[n.binding]:s};r+=M(n.body,{...t,scope:l})}continue}if(n.type==="include"){const a=t.partials?.get(n.name);if(!a)throw new Error(`${t.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const s=t.includeStack??new Set;if(s.has(n.name)){const l=[...s,n.name].join(" → ");throw new Error(`${t.filename}:${n.line}: Circular partial include detected: ${l}`)}s.add(n.name);try{r+=M(a,{...t,filename:`<partial:${n.name}>`,includeStack:s})}finally{s.delete(n.name)}}}return r},"renderNodes"),bn=w((e,t)=>ke(Ce(e),t),"parseTemplate");w((e,t)=>M(e,t),"renderAst");const X=w((e,t)=>M(ke(Ce(e),t.filename),t),"renderTemplate");var yn=Object.defineProperty,x=C((e,t)=>yn(e,"name",{value:t,configurable:!0}),"s");const ue="template.yml",$n=".raw",vn=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),wn=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),jn=x(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=t===-1?e:e.slice(t+1),n=r.lastIndexOf(".");return n===-1||n===0?"":r.slice(n).toLowerCase()},"lastDot"),Ee=x(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},"basename"),Cn=x(e=>{const t=jn(e);if(t!=="")return vn.has(t);const r=Ee(e);return wn.has(r)},"isLikelyText"),kn=x(e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},"yamlVariableToVariable"),On=x(e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),"normalizeDestinationPath"),An=x((e,t,r)=>{const n=t.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let a=e;for(let s=0;s<n.length-1;s+=1){const l=n[s],o=a[l];if(o===void 0){const h={};a[l]=h,a=h}else if(typeof o=="object"&&!Buffer.isBuffer(o))a=o;else throw new TypeError(`Path conflict: "${n.slice(0,s+1).join("/")}" is both a file and a directory`)}a[n.at(-1)]=r},"flattenFiles"),fe=x((e,t,r)=>{if(typeof e!="string")return xn(e);const n=e.includes("{{")||e.includes("{%")?X(e,{filename:`${r}#frontmatter`,scope:t}):e;return z(n,t,`${r}#frontmatter`,1)},"evaluateGate"),xn=x(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,"truthyValue"),_n=x((e,t)=>{const r=he(e,ue),n=tt(r);if(!n||typeof n!="object")throw new Error(`${r}: must contain a YAML mapping`);const a={};if(n.variables)for(const[h,i]of Object.entries(n.variables))a[h]=kn(i);const s=new Map,l=[];for(const h of rt(e,{includeDirs:!1,includeSymlinks:!1})){if(h.path===r)continue;const i=pe(e,h.path).replaceAll("\\","/");if(i===ue)continue;if(an(i)){const m=N(h.path),c=bn(m,i);for(const u of Pn(i))s.has(u)&&s.get(u)!==c&&nt.warn(`partial name "${u}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),s.set(u,c);continue}if(i.endsWith($n)){const m=N(h.path);l.push({binary:null,isRaw:!0,rawText:m,relativePath:i});continue}if(Cn(i)){const m=N(h.path);l.push({binary:null,isRaw:!1,rawText:m,relativePath:i});continue}const p=N(h.path,{buffer:!0});l.push({binary:p,isRaw:!1,rawText:null,relativePath:i})}const o=x(h=>{const i={...h.builtins,...h.options},p={},m={};for(const u of l){const f=u.relativePath;let g,b,d=!1;if(u.binary)g=u.binary;else if(u.isRaw)g=u.rawText??"";else{const v=u.rawText??"",j=ln(v,F=>at(F));if(j.frontmatter){if(j.frontmatter.skip!==void 0&&fe(j.frontmatter.skip,i,f)||j.frontmatter.if!==void 0&&!fe(j.frontmatter.if,i,f))continue;typeof j.frontmatter.to=="string"&&(b=X(j.frontmatter.to,{filename:`${f}#frontmatter.to`,partials:s,scope:i})),j.frontmatter.force===!0&&(d=!0)}g=X(j.body,{filename:f,partials:s,scope:i})}const y=On(b??rn(nn(f),i));An(p,y,g),d&&(m[y]={force:!0})}const c={files:p};return Object.keys(m).length>0&&(c.filesMeta=m),c},"produce");return{about:{description:n.description??`Moon-format template at ${e}`,name:n.title??t},destination:n.destination,options:a,produce:o}},"loadMoonTemplate"),Pn=x(e=>{const t=je(e),r=Ee(t),n=new Set([r,t]);if(r.startsWith("_")){n.add(r.replace(/^_+/,""));const a=t.slice(0,t.length-r.length);n.add(`${a}${r.replace(/^_+/,"")}`)}return[...n]},"partialKeys");export{_n as loadMoonTemplate};
3
+ `))return{body:e};const n=e.indexOf(`
4
+ ---`,3);if(n===-1)return{body:e};let s=n+1+3;e[s]==="\r"&&(s+=1),e[s]===`
5
+ `&&(s+=1);const r=e.startsWith(`---\r
6
+ `)?5:4,i=e.slice(r,n).replaceAll("\r","");let l;try{l=t(i)}catch(a){const h=a instanceof Error?a.message:String(a);throw new Error(`Failed to parse frontmatter YAML: ${h}`,{cause:a})}if(l==null)return{body:e.slice(s)};if(typeof l!="object"||Array.isArray(l))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(l)?"array":typeof l}`);return{body:e.slice(s),frontmatter:l}},"splitFrontmatter");var un=Object.defineProperty,w=k((e,t)=>un(e,"name",{value:t,configurable:!0}),"c");const pn=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,je=w(e=>{const t=[];let n=0,s=1;const r=w(i=>{for(const l of i)l===`
7
+ `&&(s+=1)},"advanceLine");for(const i of e.matchAll(pn)){const l=i.index??0;if(l>n){const o=e.slice(n,l);t.push({line:s,type:"text",value:o}),r(o)}const a=s,h=i[0];h.startsWith("{{")?t.push({line:a,type:"expr",value:(i[1]??"").trim()}):t.push({line:a,type:"stmt",value:(i[2]??"").trim()}),r(h),n=l+h.length}if(n<e.length){const i=e.slice(n);t.push({line:s,type:"text",value:i})}return t},"tokenize"),hn=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),ke=w((e,t)=>{let n=0;const s=w((i,l)=>{throw new Error(`${t}:${i}: ${l}`)},"error"),r=w(i=>{const l=[];for(;n<e.length;){const a=e[n];if(a.type==="text"){l.push({type:"text",value:a.value}),n+=1;continue}if(a.type==="expr"){l.push({expression:a.value,line:a.line,type:"expr"}),n+=1;continue}const h=a.value.split(/\s+/)[0]??"";if(i.includes(h))return l;if(hn.has(h)&&s(a.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){n+=1;const o=a.value.slice(2).trim(),p=r(["else","endif"]);let m;n<e.length&&e[n].type==="stmt"&&e[n].value.split(/\s+/)[0]==="else"&&(n+=1,m=r(["endif"])),(n>=e.length||e[n].type!=="stmt"||e[n].value.split(/\s+/)[0]!=="endif")&&s(a.line,"Unterminated {% if %} — missing {% endif %}"),n+=1,l.push({alternate:m,condition:o,consequent:p,line:a.line,type:"if"});continue}if(h==="for"){n+=1;const o=a.value.slice(3).trim(),p=o.indexOf(" in ");p===-1&&s(a.line,"Malformed {% for %} — expected `for <name> in <collection>`");const m=o.slice(0,p).trim(),c=o.slice(p+4).trim();(!m||!c)&&s(a.line,"Malformed {% for %} — missing binding or collection");const f=r(["endfor"]);(n>=e.length||e[n].type!=="stmt"||e[n].value.split(/\s+/)[0]!=="endfor")&&s(a.line,"Unterminated {% for %} — missing {% endfor %}"),n+=1,l.push({binding:m,body:f,collection:c,line:a.line,type:"for"});continue}if(h==="include"){n+=1;const o=a.value.slice(7).trim(),p=Ae(o);p===void 0&&s(a.line,"Malformed {% include %} — expected a quoted partial name"),l.push({line:a.line,name:p,type:"include"});continue}s(a.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return l},"parseBlock");return r([])},"parse"),Ae=w(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes"),mn=w(e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),"stringify"),dn=w(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,"isTruthy"),Ce=w((e,t,n,s,r=!0)=>{const i=e.split(".");if(r&&i.length>0&&!Object.hasOwn(t,i[0]))throw new Error(`${s}:${n}: Variable "${e}" is not defined`);let l=t;for(const a of i){if(l==null)return;if(typeof l!="object")throw new TypeError(`${s}:${n}: Cannot read "${a}" on non-object value`);l=l[a]}return l},"lookupVariable"),gn=w(e=>{const t=[];let n=0,s=0,r;for(let i=0;i<e.length;i+=1){const l=e[i];if(r){l===r&&(r=void 0);continue}if(l==='"'||l==="'"){r=l;continue}l==="("?n+=1:l===")"?n-=1:l==="|"&&n===0&&(t.push(e.slice(s,i)),s=i+1)}return t.push(e.slice(s)),t},"splitFilterPipe"),bn=w(e=>{const t=e.trim(),n=t.indexOf("(");if(n===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const s=t.slice(0,n).trim(),r=t.slice(n+1,-1).trim();return r?{args:ve(r).map(i=>i.trim()),name:s}:{args:[],name:s}},"parseFilterCall"),B=w((e,t,n,s,r=!0)=>{const i=e.trim();if(i==="true")return!0;if(i==="false")return!1;if(i==="null"||i==="none")return null;const l=Ae(i);return l!==void 0?l:/^-?\d+(?:\.\d+)?$/.test(i)?Number(i):Ce(i,t,n,s,r)},"evaluatePrimary"),xe=w((e,t,n,s,r=!0)=>{const i=gn(e),l=i[0].trim();let a=B(l,t,n,s,r);for(let h=1;h<i.length;h+=1){const o=i[h].trim(),{args:p,name:m}=bn(o),c=p.map(f=>B(f,t,n,s,r));try{a=ye(m,a,c)}catch(f){const u=f instanceof Error?f.message:String(f);throw new Error(`${s}:${n}: ${u}`,{cause:f})}}return a},"evaluateExpression"),Ee=w((e,t)=>{let n,s=0;for(let r=0;r<=e.length-t.length;r+=1){const i=e[r];if(n){i===n&&(n=void 0);continue}if(i==='"'||i==="'"){n=i;continue}if(i==="("){s+=1;continue}if(i===")"){s-=1;continue}if(s===0&&e.slice(r,r+t.length)===t)return r}return-1},"findOperatorOutsideQuotes"),le=w((e,t)=>{const n=[];let s=0,r=0;for(;r<=e.length-t.length;){const i=Ee(e.slice(r),t);if(i===-1)break;n.push(e.slice(s,r+i)),r+=i+t.length,s=r}return n.push(e.slice(s)),n},"splitLogical"),z=w((e,t,n,s)=>{const r=e.trim();if(r==="")return!1;if(r.startsWith("(")&&r.endsWith(")")&&yn(r)===r.length-1)return z(r.slice(1,-1),t,n,s);const i=le(r," or ");if(i.length>1)return i.some(a=>z(a,t,n,s));const l=le(r," and ");if(l.length>1)return l.every(a=>z(a,t,n,s));if(r.startsWith("not "))return!z(r.slice(4),t,n,s);for(const a of["==","!="]){const h=Ee(r,a);if(h!==-1){const o=B(r.slice(0,h),t,s,n,!1),p=B(r.slice(h+a.length),t,s,n,!1),m=o===p;return a==="=="?m:!m}}return dn(xe(r,t,s,n,!1))},"evaluateConditionExpression"),yn=w(e=>{if(e[0]!=="(")return-1;let t=0,n,s=-1;for(const r of e){if(s+=1,n){r===n&&(n=void 0);continue}if(r==='"'||r==="'"){n=r;continue}if(r==="(")t+=1;else if(r===")"&&(t-=1,t===0))return s}return-1},"matchingParen"),R=w((e,t)=>{let n="";for(const s of e){if(s.type==="text"){n+=s.value;continue}if(s.type==="expr"){n+=mn(xe(s.expression,t.scope,s.line,t.filename));continue}if(s.type==="if"){const r=z(s.condition,t.scope,t.filename,s.line)?s.consequent:s.alternate??[];n+=R(r,t);continue}if(s.type==="for"){const r=Ce(s.collection,t.scope,s.line,t.filename,!1);if(r==null)continue;if(!Array.isArray(r))throw new TypeError(`${t.filename}:${s.line}: {% for %} expected an array, got ${typeof r}`);for(const i of r){const l={...t.scope,[s.binding]:i};n+=R(s.body,{...t,scope:l})}continue}if(s.type==="include"){const r=t.partials?.get(s.name);if(!r)throw new Error(`${t.filename}:${s.line}: Partial "${s.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const i=t.includeStack??new Set;if(i.has(s.name)){const l=[...i,s.name].join(" → ");throw new Error(`${t.filename}:${s.line}: Circular partial include detected: ${l}`)}i.add(s.name);try{n+=R(r,{...t,filename:`<partial:${s.name}>`,includeStack:i})}finally{i.delete(s.name)}}}return n},"renderNodes"),$n=w((e,t)=>ke(je(e),t),"parseTemplate");w((e,t)=>R(e,t),"renderAst");const Y=w((e,t)=>R(ke(je(e),t.filename),t),"renderTemplate");var vn=Object.defineProperty,E=k((e,t)=>vn(e,"name",{value:t,configurable:!0}),"s");const ce="template.yml",wn=".raw",jn=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),kn=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),An=E(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),n=t===-1?e:e.slice(t+1),s=n.lastIndexOf(".");return s===-1||s===0?"":n.slice(s).toLowerCase()},"lastDot"),Le=E(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},"basename"),Cn=E(e=>{const t=An(e);if(t!=="")return jn.has(t);const n=Le(e);return kn.has(n)},"isLikelyText"),xn=E(e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},"yamlVariableToVariable"),En=E(e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),"normalizeDestinationPath"),Ln=E((e,t,n)=>{const s=t.split("/").filter(Boolean);if(s.length===0)throw new Error("Empty destination path for value");let r=e;for(let i=0;i<s.length-1;i+=1){const l=s[i],a=r[l];if(a===void 0){const h={};r[l]=h,r=h}else if(typeof a=="object"&&!Buffer.isBuffer(a))r=a;else throw new TypeError(`Path conflict: "${s.slice(0,i+1).join("/")}" is both a file and a directory`)}r[s.at(-1)]=n},"flattenFiles"),fe=E((e,t,n)=>{if(typeof e!="string")return On(e);const s=e.includes("{{")||e.includes("{%")?Y(e,{filename:`${n}#frontmatter`,scope:t}):e;return z(s,t,`${n}#frontmatter`,1)},"evaluateGate"),On=E(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,"truthyValue"),Tn=E((e,t)=>{const n=pe(e,ce),s=et(n);if(!s||typeof s!="object")throw new Error(`${n}: must contain a YAML mapping`);const r={};if(s.variables)for(const[h,o]of Object.entries(s.variables))r[h]=xn(o);const i=new Map,l=[];for(const h of tt(e,{includeDirs:!1,includeSymlinks:!1})){if(h.path===n)continue;const o=ue(e,h.path).replaceAll("\\","/");if(o===ce)continue;if(an(o)){const m=N(h.path),c=$n(m,o);for(const f of Wn(o))i.has(f)&&i.get(f)!==c&&nt.warn(`partial name "${f}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),i.set(f,c);continue}if(o.endsWith(wn)){const m=N(h.path);l.push({binary:null,isRaw:!0,rawText:m,relativePath:o});continue}if(Cn(o)){const m=N(h.path);l.push({binary:null,isRaw:!1,rawText:m,relativePath:o});continue}const p=N(h.path,{buffer:!0});l.push({binary:p,isRaw:!1,rawText:null,relativePath:o})}const a=E(h=>{const o={...h.builtins,...h.options},p={},m={};for(const f of l){const u=f.relativePath;let g,b,d=!1;if(f.binary)g=f.binary;else if(f.isRaw)g=f.rawText??"";else{const v=f.rawText??"",j=fn(v,F=>st(F));if(j.frontmatter){if(j.frontmatter.skip!==void 0&&fe(j.frontmatter.skip,o,u)||j.frontmatter.if!==void 0&&!fe(j.frontmatter.if,o,u))continue;typeof j.frontmatter.to=="string"&&(b=Y(j.frontmatter.to,{filename:`${u}#frontmatter.to`,partials:i,scope:o})),j.frontmatter.force===!0&&(d=!0)}g=Y(j.body,{filename:u,partials:i,scope:o})}const $=En(b??rn(on(u),o));Ln(p,$,g),d&&(m[$]={force:!0})}const c={files:p};return Object.keys(m).length>0&&(c.filesMeta=m),c},"produce");return{about:{description:s.description??`Moon-format template at ${e}`,name:s.title??t},destination:s.destination,options:r,produce:a}},"loadMoonTemplate"),Wn=E(e=>{const t=we(e),n=Le(t),s=new Set([n,t]);if(n.startsWith("_")){s.add(n.replace(/^_+/,""));const r=t.slice(0,t.length-n.length);s.add(`${r}${n.replace(/^_+/,"")}`)}return[...s]},"partialKeys");export{Tn as loadMoonTemplate};
@@ -1,4 +1,4 @@
1
- var i=Object.defineProperty;var a=(r,e)=>i(r,"name",{value:e,configurable:!0});import{p as s}from"./bin.js";import{c as o,f as c}from"../packem_shared/registry-keys-CD1xHavV.js";var n=Object.defineProperty,f=a((r,e)=>n(r,"name",{value:e,configurable:!0}),"n");const g=f(async({options:r})=>{if(r.clear){const t=o();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
1
+ var i=Object.defineProperty;var a=(r,e)=>i(r,"name",{value:e,configurable:!0});import{p as s}from"./bin.js";import{c as o,f as c}from"../packem_shared/registry-keys-Mixm4eAY.js";var n=Object.defineProperty,f=a((r,e)=>n(r,"name",{value:e,configurable:!0}),"n");const g=f(async({options:r})=>{if(r.clear){const t=o();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
2
2
  `);return}s.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await c({forceRefresh:!0});if(e===void 0){if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
3
3
  `),process.exitCode=1;return}s.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
4
4
  `);return}if(e.fromCache&&e.stale===!0){s.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}s.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)},"execute");export{g as default};
@@ -1,3 +1,3 @@
1
- var x=Object.defineProperty;var w=(t,i)=>x(t,"name",{value:i,configurable:!0});import{createRequire as B}from"node:module";import{ah as P,p as o,ai as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-Ta_yz2uP.js";import{x as C}from"../packem_shared/build-scripts-D-ysm_bS.js";import{M as y,i as k}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{n as q}from"./config.js";const D=B(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=w(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[i,f]=v.versions.node.split(".").map(Number);if(i>22||i===22&&f>=3||i===20&&f>=16)return v.getBuiltinModule(t)}return D(t)},"__cjs_getBuiltinModule"),{readdirSync:j,statSync:O}=M("node:fs");var A=Object.defineProperty,_=w((t,i)=>A(t,"name",{value:i,configurable:!0}),"p$1");const N=_((t,i={})=>{const f=y(t,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=_((n,s,a)=>{const e=`${s}@${a}`;if(p.has(e))return;p.add(e);const r=a.startsWith(t)?a.slice(t.length+1):a;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===s)||u.push({name:s,relativePath:r})},"recordBin"),m=_((n,s="")=>{let a;try{a=j(n)}catch{return}for(const e of a){const r=y(n,e);if(e.startsWith("@")){m(r,`${e}/`);continue}if(e===".pnpm"&&s===""){let c;try{c=j(r)}catch{continue}for(const d of c){const h=y(r,d,"node_modules");k(h)&&m(h)}continue}if(e.startsWith("."))continue;const u=s+e,$=y(r,"package.json");try{if(!O(r).isDirectory()||!k($))continue;const c=q($),d=typeof c.name=="string"?c.name:u;if(typeof c.bin=="string"){const S=d.includes("/")?d.split("/").pop():d;b(S,d,r)}else if(c.bin&&typeof c.bin=="object")for(const S of Object.keys(c.bin))b(S,d,r);const h=y(r,"node_modules");k(h)&&m(h)}catch{}}},"scanDir");m(f);const g=[];for(const[n,s]of l)s.length<2||i[n]===!0||s.every(a=>i[`${a.name}#${n}`]===!0)||g.push({bin:n,packages:s});return g.sort((n,s)=>n.bin.localeCompare(s.bin))},"collectBinShadows");var T=Object.defineProperty,W=w((t,i)=>T(t,"name",{value:i,configurable:!0}),"p");const U=new Set(["bun","npm","pnpm","yarn"]),K=W(({options:t,visConfig:i,workspaceRoot:f})=>{const l=f??process.cwd(),p=V(l),b=i?.security?.policies?.installScripts?.allow??{},m=i?.security?.allowBins??{},g=i?.security?.pinVersions===!0,n=C(l,b,{pinVersions:g}),s=N(l,m),a=i&&U.has(p.name)?P(i,p.name,l):void 0;if(t.json){process.stdout.write(`${JSON.stringify({binConflicts:s,drift:a,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
1
+ var x=Object.defineProperty;var w=(t,s)=>x(t,"name",{value:s,configurable:!0});import{createRequire as B}from"node:module";import{ah as P,p as o,ai as R}from"./bin.js";import{A as V}from"../packem_shared/pm-runner-DmKT2FqF.js";import{x as C}from"../packem_shared/build-scripts-DE6U8jVq.js";import{M as y,l as k}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as q}from"./config.js";const D=B(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=w(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[s,f]=v.versions.node.split(".").map(Number);if(s>22||s===22&&f>=3||s===20&&f>=16)return v.getBuiltinModule(t)}return D(t)},"__cjs_getBuiltinModule"),{readdirSync:j,statSync:O}=M("node:fs");var A=Object.defineProperty,_=w((t,s)=>A(t,"name",{value:s,configurable:!0}),"p$1");const N=_((t,s={})=>{const f=y(t,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=_((n,i,a)=>{const e=`${i}@${a}`;if(p.has(e))return;p.add(e);const r=a.startsWith(t)?a.slice(t.length+1):a;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===i)||u.push({name:i,relativePath:r})},"recordBin"),m=_((n,i="")=>{let a;try{a=j(n)}catch{return}for(const e of a){const r=y(n,e);if(e.startsWith("@")){m(r,`${e}/`);continue}if(e===".pnpm"&&i===""){let c;try{c=j(r)}catch{continue}for(const d of c){const h=y(r,d,"node_modules");k(h)&&m(h)}continue}if(e.startsWith("."))continue;const u=i+e,$=y(r,"package.json");try{if(!O(r).isDirectory()||!k($))continue;const c=q($),d=typeof c.name=="string"?c.name:u;if(typeof c.bin=="string"){const S=d.includes("/")?d.split("/").pop():d;b(S,d,r)}else if(c.bin&&typeof c.bin=="object")for(const S of Object.keys(c.bin))b(S,d,r);const h=y(r,"node_modules");k(h)&&m(h)}catch{}}},"scanDir");m(f);const g=[];for(const[n,i]of l)i.length<2||s[n]===!0||i.every(a=>s[`${a.name}#${n}`]===!0)||g.push({bin:n,packages:i});return g.sort((n,i)=>n.bin.localeCompare(i.bin))},"collectBinShadows");var T=Object.defineProperty,W=w((t,s)=>T(t,"name",{value:s,configurable:!0}),"p");const U=new Set(["bun","npm","pnpm","yarn"]),K=W(({options:t,visConfig:s,workspaceRoot:f})=>{const l=f??process.cwd(),p=V(l),b=s?.security?.policies?.installScripts?.allow??{},m=s?.security?.allowBins??{},g=s?.security?.pinVersions===!0,n=C(l,b,{pinVersions:g}),i=N(l,m),a=s&&U.has(p.name)?P(s,p.name,l):void 0;if(t.json){process.stdout.write(`${JSON.stringify({binConflicts:i,drift:a,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
2
2
  `);return}if(o.info(`Build-script status (${p.name}):
3
- `),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:r}of n.versionDrift)o.info(` ${e} → ${r}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(s.length>0){o.info(""),o.warn(` Bin conflicts (${String(s.length)}) — multiple packages expose the same bin name:`);for(const e of s)o.info(` ${e.bin} ← ${e.packages.map(r=>r.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(a?.hasDrift){o.info("");for(const e of R(a))o.warn(e)}},"execute");export{K as default};
3
+ `),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:r}of n.versionDrift)o.info(` ${e} → ${r}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(i.length>0){o.info(""),o.warn(` Bin conflicts (${String(i.length)}) — multiple packages expose the same bin name:`);for(const e of i)o.info(` ${e.bin} ← ${e.packages.map(r=>r.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(a?.hasDrift){o.info("");for(const e of R(a))o.warn(e)}},"execute");export{K as default};
@@ -1,4 +1,4 @@
1
- var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-Ta_yz2uP.js";const _=y(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=c(e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,s]=a.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return a.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:I}=v("node:readline");var h=Object.defineProperty,o=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"n");const r="sigstore",b=o(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),O=o(e=>new Promise(t=>{const s=I({input:process.stdin,output:process.stderr});s.question(`${e} (Y/n) `,i=>{s.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),"defaultPrompt"),D=o(e=>{const t=m(e),s=$(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[r],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:s})},"defaultRunInstall"),k=o(()=>{try{return import.meta.resolve(r),!0}catch{return!1}},"isSigstoreInstalled"),P=o(e=>{let t="pnpm";try{t=m(e).name}catch{}switch(t){case"bun":return`bun add -d ${r}`;case"npm":return`npm install -D ${r}`;case"yarn":return`yarn add -D ${r}`;default:return`pnpm add -D ${r}`}},"installCommandFor"),R=o(()=>import("sigstore"),"defaultImport"),x=o(async(e={})=>{const t=e.interactive??b(),s=e.prompt??O,i=e.runInstall??D,n=e.importImpl??R,d=e.workspaceRoot??process.cwd(),l=P(d);try{return await n()}catch(p){const{code:f,message:g}=p;if(!(f==="ERR_MODULE_NOT_FOUND"||f==="MODULE_NOT_FOUND")||!g.includes(r))throw p}if(!t)throw new Error(`${r} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
1
+ var w=Object.defineProperty;var c=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as y}from"node:module";import{A as m,P as $}from"../packem_shared/pm-runner-DmKT2FqF.js";const _=y(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=c(e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,s]=a.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return a.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:I}=v("node:readline");var h=Object.defineProperty,o=c((e,t)=>h(e,"name",{value:t,configurable:!0}),"n");const r="sigstore",b=o(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),O=o(e=>new Promise(t=>{const s=I({input:process.stdin,output:process.stderr});s.question(`${e} (Y/n) `,i=>{s.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),"defaultPrompt"),D=o(e=>{const t=m(e),s=$(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[r],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:s})},"defaultRunInstall"),k=o(()=>{try{return import.meta.resolve(r),!0}catch{return!1}},"isSigstoreInstalled"),P=o(e=>{let t="pnpm";try{t=m(e).name}catch{}switch(t){case"bun":return`bun add -d ${r}`;case"npm":return`npm install -D ${r}`;case"yarn":return`yarn add -D ${r}`;default:return`pnpm add -D ${r}`}},"installCommandFor"),R=o(()=>import("sigstore"),"defaultImport"),x=o(async(e={})=>{const t=e.interactive??b(),s=e.prompt??O,i=e.runInstall??D,n=e.importImpl??R,d=e.workspaceRoot??process.cwd(),l=P(d);try{return await n()}catch(p){const{code:f,message:g}=p;if(!(f==="ERR_MODULE_NOT_FOUND"||f==="MODULE_NOT_FOUND")||!g.includes(r))throw p}if(!t)throw new Error(`${r} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
2
2
  ${l}`);if(!await s(`${r} isn't installed. Install it now?`))throw new Error(`${r} install declined. Re-run \`vis attest\` after installing manually:
3
3
  ${l}`);const u=await i(d);if(u.exitCode!==0)throw new Error(`Install of ${r} failed (exit ${String(u.exitCode)}). Install manually and retry:
4
4
  ${l}`);return await n()},"loadOptionalSigstore");export{P as installCommandFor,k as isSigstoreInstalled,x as loadOptionalSigstore};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{K as n}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{createJiti as l}from"jiti";var p=Object.defineProperty,a=o((t,e)=>p(t,"name",{value:e,configurable:!0}),"r");const i=a((t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const r=e;if(typeof r.about!="object"||r.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof r.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},"validateTemplateExport"),s=a(async t=>{const e=await l(n(t),{fsCache:!1,moduleCache:!1}).import(t,{default:!0,try:!0})??null;return i(t,e)},"loadNativeTemplate");export{s as loadNativeTemplate};
1
+ var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{K as n}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{createJiti as l}from"jiti";var p=Object.defineProperty,a=o((t,e)=>p(t,"name",{value:e,configurable:!0}),"r");const i=a((t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const r=e;if(typeof r.about!="object"||r.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof r.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},"validateTemplateExport"),s=a(async t=>{const e=await l(n(t),{fsCache:!1,moduleCache:!1}).import(t,{default:!0,try:!0})??null;return i(t,e)},"loadNativeTemplate");export{s as loadNativeTemplate};
@@ -1,3 +1,3 @@
1
- var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-DpgSuWDH.js";var p=Object.defineProperty,l=u((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const v=l(async({fs:r,logger:o,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=t.db??m(n),a=t.format==="json";if(!t.force){s.warn(`Prune is destructive. Will remove: ${e}`),s.info("Re-run with --force to proceed."),a&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
1
+ var d=Object.defineProperty;var u=(r,o)=>d(r,"name",{value:o,configurable:!0});import{p as s}from"./bin.js";import{r as m}from"../packem_shared/advisories-BxXiKFbL.js";var p=Object.defineProperty,l=u((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const v=l(async({fs:r,logger:o,options:t,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=t.db??m(n),a=t.format==="json";if(!t.force){s.warn(`Prune is destructive. Will remove: ${e}`),s.info("Re-run with --force to proceed."),a&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
2
2
  `);return}const f=[e,`${e}-wal`,`${e}-shm`,`${e}-journal`],i=[];for(const c of f)try{await r.rm(c,{force:!0}),i.push(c)}catch{}if(a){process.stdout.write(`${JSON.stringify({dbPath:e,files:i,removed:!0})}
3
3
  `);return}s.success(`Removed ${e}.`)},"execute"),b=v;export{b as advisoriesPruneExecute};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var a=(t,o)=>l(t,"name",{value:o,configurable:!0});import{p as c,H as p,I as u}from"./bin.js";var w=Object.defineProperty,f=a((t,o)=>w(t,"name",{value:o,configurable:!0}),"c");const m=f(({options:t,visConfig:o,workspaceRoot:s})=>{const i=s??process.cwd(),n=o?.security?.policies?.installScripts?.allow??{},r=Object.entries(n).filter(([,e])=>e).map(([e])=>e);r.length===0&&!t.rootOnly&&(c.warn("No approved packages in security.policies.installScripts.allow — nothing to run."),!t.withRoot)||(t.rootOnly||p(i,r),(t.withRoot||t.rootOnly)&&u(i))},"execute");export{m as default};
1
+ var l=Object.defineProperty;var a=(t,o)=>l(t,"name",{value:o,configurable:!0});import{p as c,I as p,L as u}from"./bin.js";var w=Object.defineProperty,f=a((t,o)=>w(t,"name",{value:o,configurable:!0}),"c");const m=f(({options:t,visConfig:o,workspaceRoot:s})=>{const i=s??process.cwd(),n=o?.security?.policies?.installScripts?.allow??{},r=Object.entries(n).filter(([,e])=>e).map(([e])=>e);r.length===0&&!t.rootOnly&&(c.warn("No approved packages in security.policies.installScripts.allow — nothing to run."),!t.withRoot)||(t.rootOnly||p(i,r),(t.withRoot||t.rootOnly)&&u(i))},"execute");export{m as default};
@@ -1,2 +1,2 @@
1
- var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-DpgSuWDH.js";var $=Object.defineProperty,i=c((s,e)=>$(s,"name",{value:e,configurable:!0}),"a");const B=i(s=>{if(s===0)return"0 B";const e=["B","KB","MB","GB"],a=Math.min(Math.floor(Math.log(s)/Math.log(1024)),e.length-1),o=s/1024**a;return`${o.toFixed(o<10&&a>0?1:0)} ${e[a]}`},"formatBytes"),w=i(s=>{if(!s)return"never";const e=Date.parse(s);if(Number.isNaN(e))return s;const a=Date.now()-e;if(a<0)return s;const o=Math.floor(a/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const t=Math.floor(o/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},"formatRelative"),S=i(async({logger:s,options:e,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=e.db??g(a),t=await h(a,o);if(e.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:t.ecosystems.map(n=>({advisoryCount:n.advisoryCount,lastSyncIso:n.lastSyncIso,manifestEtag:n.manifestEtag??null,name:n.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
1
+ var l=Object.defineProperty;var c=(s,e)=>l(s,"name",{value:e,configurable:!0});import{e as v,E as f,I as p}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{p as r}from"./bin.js";import{r as g,g as h}from"../packem_shared/advisories-BxXiKFbL.js";var $=Object.defineProperty,i=c((s,e)=>$(s,"name",{value:e,configurable:!0}),"a");const B=i(s=>{if(s===0)return"0 B";const e=["B","KB","MB","GB"],a=Math.min(Math.floor(Math.log(s)/Math.log(1024)),e.length-1),o=s/1024**a;return`${o.toFixed(o<10&&a>0?1:0)} ${e[a]}`},"formatBytes"),w=i(s=>{if(!s)return"never";const e=Date.parse(s);if(Number.isNaN(e))return s;const a=Date.now()-e;if(a<0)return s;const o=Math.floor(a/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const t=Math.floor(o/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`},"formatRelative"),S=i(async({logger:s,options:e,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=e.db??g(a),t=await h(a,o);if(e.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:t.ecosystems.map(n=>({advisoryCount:n.advisoryCount,lastSyncIso:n.lastSyncIso,manifestEtag:n.manifestEtag??null,name:n.name})),exists:t.exists,schemaVersion:t.schemaVersion,sizeBytes:t.sizeBytes},void 0,2)}
2
2
  `);return}if(r.info(`DB: ${o}`),!t.exists){r.warn(`No advisory DB yet. Run ${v("vis advisories sync")} to populate.`);return}if(r.info(`Schema: v${t.schemaVersion} Size: ${B(t.sizeBytes)}`),t.ecosystems.length===0){r.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}r.info(""),r.info("Ecosystem Advisories Last sync ETag"),r.info(f("────────── ────────── ───────────────── ──────"));for(const n of t.ecosystems){const m=n.name.padEnd(10),u=n.advisoryCount.toLocaleString().padStart(10),d=`${n.lastSyncIso||"never"} (${w(n.lastSyncIso)})`.padEnd(19),y=n.manifestEtag??f("—");r.info(`${p(m)} ${u} ${d} ${y}`)}},"execute"),D=S;export{D as advisoriesStatusExecute};
@@ -1,2 +1,2 @@
1
- var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-CTVVf9WW.js";import{s as b,D as S}from"../packem_shared/advisories-DpgSuWDH.js";var E=Object.defineProperty,c=y((e,o)=>E(e,"name",{value:o,configurable:!0}),"c");const P=c(e=>e?.security?.audit?.advisories??{},"readAdvisoriesConfig"),k=c(e=>e?e.split(",").map(o=>o.trim()).filter(o=>o.length>0):["npm"],"parseEcosystems"),x=c(async({logger:e,options:o,visConfig:g,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const u=o.format==="json",m=P(g),f=o.source??m.source??S,p=k(o.ecosystem),v=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=D(v,{live:!u}),i=[];try{for(const s of p){n.start(s);const r=Date.now();try{const t=await b({allowedHosts:m.allowedHosts,dbPath:o.db,ecosystem:s,force:!!o.force,source:f,workspaceRoot:d});i.push({ecosystem:s,result:t}),t.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-r)}`):n.finish(s,"ok",`${t.advisoriesIngested.toLocaleString()} advisories · ${h(t.durationMs)}`)}catch(t){const a=t instanceof Error?t.message:String(t);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(u){const s={ecosystems:i.map(r=>({advisoriesIngested:r.result?.advisoriesIngested??0,dbPath:r.result?.dbPath??null,durationMs:r.result?.durationMs??0,ecosystem:r.ecosystem,error:r.error??null,upToDate:r.result?.upToDate??!1})),source:f};process.stdout.write(`${JSON.stringify(s,void 0,2)}
1
+ var w=Object.defineProperty;var y=(e,o)=>w(e,"name",{value:o,configurable:!0});import{E as $}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{p as l}from"./bin.js";import{s as D}from"../packem_shared/scan-progress-DVtCtI2z.js";import{s as b,D as S}from"../packem_shared/advisories-BxXiKFbL.js";var E=Object.defineProperty,c=y((e,o)=>E(e,"name",{value:o,configurable:!0}),"c");const P=c(e=>e?.security?.audit?.advisories??{},"readAdvisoriesConfig"),k=c(e=>e?e.split(",").map(o=>o.trim()).filter(o=>o.length>0):["npm"],"parseEcosystems"),x=c(async({logger:e,options:o,visConfig:g,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const u=o.format==="json",m=P(g),f=o.source??m.source??S,p=k(o.ecosystem),v=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=D(v,{live:!u}),i=[];try{for(const s of p){n.start(s);const r=Date.now();try{const t=await b({allowedHosts:m.allowedHosts,dbPath:o.db,ecosystem:s,force:!!o.force,source:f,workspaceRoot:d});i.push({ecosystem:s,result:t}),t.upToDate?n.finish(s,"ok",`up to date · ${h(Date.now()-r)}`):n.finish(s,"ok",`${t.advisoriesIngested.toLocaleString()} advisories · ${h(t.durationMs)}`)}catch(t){const a=t instanceof Error?t.message:String(t);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(u){const s={ecosystems:i.map(r=>({advisoriesIngested:r.result?.advisoriesIngested??0,dbPath:r.result?.dbPath??null,durationMs:r.result?.durationMs??0,ecosystem:r.ecosystem,error:r.error??null,upToDate:r.result?.upToDate??!1})),source:f};process.stdout.write(`${JSON.stringify(s,void 0,2)}
2
2
  `)}else{const s=i.filter(a=>a.error),r=i.filter(a=>a.result),t=r[0];t?.result?.dbPath&&l.info($(`DB: ${t.result.dbPath}`)),s.length===0?l.success(`Synced ${r.length} ecosystem${r.length===1?"":"s"}.`):l.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},"execute"),h=c(e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,"formatDuration"),O=x;export{O as advisoriesSyncExecute};
@@ -1,2 +1,2 @@
1
- var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-Ta_yz2uP.js";import{N as y}from"../packem_shared/native-config-sync-CgRIIRZV.js";import{E as v}from"../packem_shared/min-release-age-YyNI7gqV.js";var h=Object.defineProperty,w=f((e,n)=>h(e,"name",{value:n,configurable:!0}),"l");const b=new Set(["bun","npm","pnpm","yarn"]),x=w(({options:e,visConfig:n,workspaceRoot:u})=>{const o=u??process.cwd(),t=g(o);if(!b.has(t.name)){i.warn(`Package manager '${t.name}' has no native security config to sync.`);return}if(!n?.security){i.warn("vis.config has no `security` block — nothing to sync.");return}const r=n.security.policies??{},a=Object.fromEntries(Object.entries(r.installScripts?.allow??{}).filter(([,c])=>c)),p=r.firstSeen?.minutes,l=r.firstSeen?.exclude??[],s=[];if(Object.keys(a).length>0&&!e.skipAllowBuilds&&s.push(...y(t.name,o,a)),e.skipMinReleaseAge||s.push(...v(t.name,o,p,l)),s.length===0){i.success("Nothing to sync — vis.config and native PM config are aligned.");return}i.info(`Syncing vis.config security settings to ${t.name} native config…
1
+ var m=Object.defineProperty;var f=(e,n)=>m(e,"name",{value:n,configurable:!0});import{p as i}from"./bin.js";import{A as g}from"../packem_shared/pm-runner-DmKT2FqF.js";import{N as y}from"../packem_shared/native-config-sync-BRZZetn3.js";import{E as v}from"../packem_shared/min-release-age-BPVXwPUg.js";var h=Object.defineProperty,w=f((e,n)=>h(e,"name",{value:n,configurable:!0}),"l");const b=new Set(["bun","npm","pnpm","yarn"]),x=w(({options:e,visConfig:n,workspaceRoot:u})=>{const o=u??process.cwd(),t=g(o);if(!b.has(t.name)){i.warn(`Package manager '${t.name}' has no native security config to sync.`);return}if(!n?.security){i.warn("vis.config has no `security` block — nothing to sync.");return}const r=n.security.policies??{},a=Object.fromEntries(Object.entries(r.installScripts?.allow??{}).filter(([,c])=>c)),p=r.firstSeen?.minutes,l=r.firstSeen?.exclude??[],s=[];if(Object.keys(a).length>0&&!e.skipAllowBuilds&&s.push(...y(t.name,o,a)),e.skipMinReleaseAge||s.push(...v(t.name,o,p,l)),s.length===0){i.success("Nothing to sync — vis.config and native PM config are aligned.");return}i.info(`Syncing vis.config security settings to ${t.name} native config…
2
2
  `);for(const c of s)i.success(` ${c}`)},"execute");export{x as default};
@@ -1,2 +1,2 @@
1
- var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,i as f}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{n as m,q as k}from"./config.js";import{p as e}from"./bin.js";import{A as j}from"../packem_shared/pm-runner-Ta_yz2uP.js";const v=w(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(r)}return v(r)},"__cjs_getBuiltinModule"),{spawnSync:$}=h("node:child_process");var _=Object.defineProperty,l=d((r,n)=>_(r,"name",{value:n,configurable:!0}),"c");const t="@lavamoat/preinstall-always-fail",p=l(r=>{const n=u(r,"package.json");if(!f(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},"tripwireStatus"),b=l(r=>{const n=u(r,"package.json");if(!f(n))return!1;try{const s=m(n);let o=!1;const a=l(i=>!i||!(t in i)?i:(o=!0,Object.fromEntries(Object.entries(i).filter(([g])=>g!==t))),"stripFrom");return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),o&&k(n,`${JSON.stringify(s,null,2)}
2
- `),o}catch{return!1}},"removeFromPackageJson"),q=l(({options:r,workspaceRoot:n})=>{const s=n??process.cwd();if(r.status){switch(p(s)){case"installed":{e.success(`Preinstall tripwire is installed (${t}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${t} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(r.remove){b(s)?e.success(`Removed ${t} from package.json. Run your PM's install to clean node_modules.`):e.info(`${t} was not present in package.json.`);return}if(p(s)==="installed"){e.info(`${t} is already installed.`);return}const o=j(s),a={bun:["add","-d",t],npm:["install","--save-dev",t],pnpm:["add","-D","-w",t],yarn:["add","-D",t]}[o.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${o.name}'.`),process.exitCode=1;return}e.info(`Installing ${t} via ${o.name}…`);const i=$(o.name,a,{cwd:s,stdio:"inherit"});if(i.error){e.error(`Failed to install tripwire: ${i.error.message}`),process.exitCode=1;return}if(i.signal!==null){e.error(`${o.name} was terminated by signal ${i.signal}`),process.exitCode=1;return}if(i.status!==0){e.error(`${o.name} exited with code ${String(i.status)}`),process.exitCode=i.status??1;return}e.success(`Installed ${t} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${t} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")},"execute");export{q as default};
1
+ var y=Object.defineProperty;var d=(r,n)=>y(r,"name",{value:n,configurable:!0});import{createRequire as w}from"node:module";import{M as u,l as f}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as m,E as k}from"./config.js";import{p as e}from"./bin.js";import{A as j}from"../packem_shared/pm-runner-DmKT2FqF.js";const v=w(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=d(r=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[n,s]=l.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return l.getBuiltinModule(r)}return v(r)},"__cjs_getBuiltinModule"),{spawnSync:h}=$("node:child_process");var _=Object.defineProperty,c=d((r,n)=>_(r,"name",{value:n,configurable:!0}),"c");const t="@lavamoat/preinstall-always-fail",p=c(r=>{const n=u(r,"package.json");if(!f(n))return"no-package-json";try{const s=m(n);if(s.devDependencies?.[t]||s.dependencies?.[t])return"installed"}catch{}return"missing"},"tripwireStatus"),b=c(r=>{const n=u(r,"package.json");if(!f(n))return!1;try{const s=m(n);let o=!1;const a=c(i=>!i||!(t in i)?i:(o=!0,Object.fromEntries(Object.entries(i).filter(([g])=>g!==t))),"stripFrom");return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),o&&k(n,`${JSON.stringify(s,null,2)}
2
+ `),o}catch{return!1}},"removeFromPackageJson"),O=c(({options:r,workspaceRoot:n})=>{const s=n??process.cwd();if(r.status){switch(p(s)){case"installed":{e.success(`Preinstall tripwire is installed (${t}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${t} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(r.remove){b(s)?e.success(`Removed ${t} from package.json. Run your PM's install to clean node_modules.`):e.info(`${t} was not present in package.json.`);return}if(p(s)==="installed"){e.info(`${t} is already installed.`);return}const o=j(s),a={bun:["add","-d",t],npm:["install","--save-dev",t],pnpm:["add","-D","-w",t],yarn:["add","-D",t]}[o.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${o.name}'.`),process.exitCode=1;return}e.info(`Installing ${t} via ${o.name}…`);const i=h(o.name,a,{cwd:s,stdio:"inherit"});if(i.error){e.error(`Failed to install tripwire: ${i.error.message}`),process.exitCode=1;return}if(i.signal!==null){e.error(`${o.name} was terminated by signal ${i.signal}`),process.exitCode=1;return}if(i.status!==0){e.error(`${o.name} exited with code ${String(i.status)}`),process.exitCode=i.status??1;return}e.success(`Installed ${t} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${t} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")},"execute");export{O as default};
@@ -1,2 +1,2 @@
1
- var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as S}from"../packem_shared/pm-runner-Ta_yz2uP.js";import{r as v,l as x,L as C}from"../packem_shared/dependency-scan-B9wTcLxf.js";import{$ as M,M as h,i as L}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{S as E}from"../packem_shared/lockfile-CoeFxWAv.js";import{e as P}from"../packem_shared/index-BfG9_znI.js";var D=Object.defineProperty,m=k((e,o)=>D(e,"name",{value:o,configurable:!0}),"r");const V=m(e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},"isExoticSpecifier"),N=m((e,o)=>{for(const s of o)if(s===e||s.endsWith("*")&&e.startsWith(s.slice(0,-1)))return!0;return!1},"matchesAllow"),O=m((e,o,s={})=>{const t=v(e,o);if(!t)return[];let i;try{i=M(h(e,t.file))}catch{return[]}const n=E(i,t.type);if(n.length===0)return[];const c=s.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const g of[r.dependencies,r.optionalDependencies])if(g){for(const[u,w]of Object.entries(g))if(!N(u,c))for(const y of w){if(!V(y))continue;const b=`${a}->${u}@${y}`;f.has(b)||(f.add(b),l.push({declaredBy:a,packageName:u,source:y}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},"scanExoticSubdeps");var R=Object.defineProperty,d=k((e,o)=>R(e,"name",{value:o,configurable:!0}),"n");const j=new Set(["firstSeen","publisherChange"]),A=d(e=>e.severity==="block"&&e.acceptedRisk===void 0,"isGatingDecision"),B=d(e=>{const o=e.security?.policies?.firstSeen?.minutes,s=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return s||t||i},"anyPolicyConfigured"),F=d(async e=>{const{offline:o=!1,packageManager:s,visConfig:t,workspaceRoot:i}=e,n=Date.now();if(!B(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=v(i,s);if(!c||!L(h(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=x(i,s,{includeDev:!0}),f=l.length,r=await P({offline:o,packageManager:s,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(j),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?O(i,s,{allow:t.security.exoticSubdepsAllow}):[],g=r.some(u=>A(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:g?"fail":"pass"}},"verifyLockfile"),W=d(e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,"formatElapsed"),G=d(e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${W(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const s=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&s.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)s.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return s},"formatLockfileVerification");var I=Object.defineProperty,J=k((e,o)=>I(e,"name",{value:o,configurable:!0}),"a");const U=J(async({options:e,visConfig:o,workspaceRoot:s})=>{const t=s??process.cwd(),i=S(t);if(!C[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await F({offline:!!e.offline,packageManager:i.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
1
+ var $=Object.defineProperty;var k=(e,o)=>$(e,"name",{value:o,configurable:!0});import{p}from"./bin.js";import{A as S}from"../packem_shared/pm-runner-DmKT2FqF.js";import{r as v,l as x,L as C}from"../packem_shared/dependency-scan-BUbOcMwX.js";import{B as M,M as h,l as L}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{S as E}from"../packem_shared/lockfile-CrT86D6d.js";import{e as P}from"../packem_shared/index-D1xC1Y_R.js";var D=Object.defineProperty,m=k((e,o)=>D(e,"name",{value:o,configurable:!0}),"r");const V=m(e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},"isExoticSpecifier"),N=m((e,o)=>{for(const s of o)if(s===e||s.endsWith("*")&&e.startsWith(s.slice(0,-1)))return!0;return!1},"matchesAllow"),O=m((e,o,s={})=>{const t=v(e,o);if(!t)return[];let i;try{i=M(h(e,t.file))}catch{return[]}const n=E(i,t.type);if(n.length===0)return[];const c=s.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const g of[r.dependencies,r.optionalDependencies])if(g){for(const[u,w]of Object.entries(g))if(!N(u,c))for(const y of w){if(!V(y))continue;const b=`${a}->${u}@${y}`;f.has(b)||(f.add(b),l.push({declaredBy:a,packageName:u,source:y}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},"scanExoticSubdeps");var R=Object.defineProperty,d=k((e,o)=>R(e,"name",{value:o,configurable:!0}),"n");const j=new Set(["firstSeen","publisherChange"]),B=d(e=>e.severity==="block"&&e.acceptedRisk===void 0,"isGatingDecision"),A=d(e=>{const o=e.security?.policies?.firstSeen?.minutes,s=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return s||t||i},"anyPolicyConfigured"),F=d(async e=>{const{offline:o=!1,packageManager:s,visConfig:t,workspaceRoot:i}=e,n=Date.now();if(!A(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=v(i,s);if(!c||!L(h(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=x(i,s,{includeDev:!0}),f=l.length,r=await P({offline:o,packageManager:s,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(j),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?O(i,s,{allow:t.security.exoticSubdepsAllow}):[],g=r.some(u=>B(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:g?"fail":"pass"}},"verifyLockfile"),W=d(e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,"formatElapsed"),G=d(e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${W(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const s=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&s.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)s.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return s},"formatLockfileVerification");var I=Object.defineProperty,J=k((e,o)=>I(e,"name",{value:o,configurable:!0}),"a");const U=J(async({options:e,visConfig:o,workspaceRoot:s})=>{const t=s??process.cwd(),i=S(t);if(!C[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await F({offline:!!e.offline,packageManager:i.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
2
2
  `),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=G(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1},"execute");export{U as default};