@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,4 +1,4 @@
1
- var oi=Object.defineProperty;var m=(t,e)=>oi(t,"name",{value:e,configurable:!0});import{createRequire as ai}from"node:module";import{M as he,K as li,Q as di,$ as ui}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{bR as _s,w as K,a5 as a,a6 as $,n as d,bS as fi,d as $e,R as te,aG as Gs,aI as hi,aF as pi,af as is,aJ as gi,aK as mi,k as vi,M as Bt,O as or,bT as wi,bU as yi,D as Et,bV as $i,L as xi,C as bi,S as ki,bW as ji,bX as Si,s as pt,bY as Ti,aM as Ci,bZ as Ii,b_ as Ri,b$ as Oi,c0 as Ei,W as Mi,c1 as Pi}from"./bin.js";import{buildEnhancedPath as Fi,runConcurrently as Mt,TerminalBuffer as ar,readLastRunSummary as Ai,getLastRunSummaryPath as Li,enforceProjectConstraints as Di,expandTokensInString as os,parsePartition as Bi,TaskScheduler as Ni,createTaskGraph as _i,reverseTaskGraph as Gi,generateRunSummary as as,writeChromeTrace as qi,resolveTurboEnvCompat as Ui,CompositeLifeCycle as cs,defaultTaskRunner as ls,createLogReporter as Wi,writeRunSummary as Hi}from"@visulima/task-runner";import{d as zi,r as Vi}from"../packem_shared/lockfile-DAuTDwow.js";import{F as eo}from"../packem_shared/failure-log-n3j_-w8s.js";import{r as to}from"../packem_shared/toolchain-juKl-WgV.js";import{i as ro,a as so,b as no,s as io,d as oo,c as ao,r as co,H as lo,f as uo,e as fo}from"../packem_shared/lifecycle-NHIKDiCh.js";import{p as ho,r as po,f as go}from"../packem_shared/selectors-BU8aTRQm.js";import{T as Us,C as lr,D as Nt,E as Ws}from"../packem_shared/symbols-CQmER5MT.js";import{q as $o,j as xo,T as Vt,E as fs}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{n as Hs}from"../packem_shared/spinner-C8xs6QZv.js";import{c as hs,a as To,s as ps}from"../packem_shared/watch-DdR-pFzX.js";import{q as zs}from"./config.js";const ci=ai(import.meta.url),ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=m(t=>{if(typeof ht<"u"&&ht.versions&&ht.versions.node){const[e,r]=ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ht.getBuiltinModule(t)}return ci(t)},"__cjs_getBuiltinModule"),{readFileSync:at,existsSync:Ze,writeFileSync:cr,mkdirSync:Ki,openSync:Yi,statSync:ds,readSync:Ji,closeSync:Xi,mkdtempSync:Qi}=_e("node:fs"),{createInterface:qs,emitKeypressEvents:Zi}=_e("node:readline"),{isAbsolute:mo,resolve:us,dirname:vo,relative:wo}=_e("node:path"),{fileURLToPath:yo}=_e("node:url"),{createRequire:bo}=_e("node:module"),{createHash:ko}=_e("node:crypto"),{appendFile:dr}=_e("node:fs/promises"),{platform:jo,homedir:ur,tmpdir:So}=_e("node:os"),{spawn:Co}=_e("node:child_process");var Io=Object.defineProperty,Ro=m((t,e)=>Io(t,"name",{value:e,configurable:!0}),"u$5"),Oo=Object.defineProperty,Eo=Ro((t,e)=>Oo(t,"name",{value:e,configurable:!0}),"v"),Mo=Object.defineProperty,Po=Eo((t,e)=>Mo(t,"name",{value:e,configurable:!0}),"D");const Fo=Po((t,e,r,s,i,o,n,c,u,h,f,p,l,g)=>{const w={d:s,h:i,m:o,mo:e,ms:c,s:n,w:r,y:t};return u!==void 0&&(w.future=u),h!==void 0&&(w.past=h),f!==void 0&&(w.decimal=f),p!==void 0&&(w.unitMap=p),l!==void 0&&(w.groupSeparator=l),g!==void 0&&(w.placeholderSeparator=g),w},"createDurationLanguage"),Ao={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},Lo=Fo(t=>`year${t===1?"":"s"}`,t=>`month${t===1?"":"s"}`,t=>`week${t===1?"":"s"}`,t=>`day${t===1?"":"s"}`,t=>`hour${t===1?"":"s"}`,t=>`minute${t===1?"":"s"}`,t=>`second${t===1?"":"s"}`,t=>`millisecond${t===1?"":"s"}`,"in %s","%s ago",".",Ao,",","_");var Do=Object.defineProperty,Bo=m((t,e)=>Do(t,"name",{value:e,configurable:!0}),"o$4"),No=Object.defineProperty,_o=Bo((t,e)=>No(t,"name",{value:e,configurable:!0}),"o"),Go=Object.defineProperty,qo=_o((t,e)=>Go(t,"name",{value:e,configurable:!0}),"o");const Uo=qo(t=>{const e=["y","mo","w","d","h","m","s","ms","future","past"];for(const s of e)if(!Object.hasOwn(t,s))throw new TypeError(`Missing required property: ${s}`);if(typeof t.future!="string"||typeof t.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const s of r)if(typeof t[s]!="string"&&typeof t[s]!="function")throw new TypeError(`Property ${s} must be of type string or function`);if(t.decimal&&typeof t.decimal!="string")throw new TypeError("Property decimal must be of type string");if(t.delimiter&&typeof t.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(t._digitReplacements&&!Array.isArray(t._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(t._numberFirst&&typeof t._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(t.unitMap&&typeof t.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(t.unitMap&&Object.values(t.unitMap).some(s=>typeof s!="string"))throw new TypeError("All values in unitMap must be of type string")},"validateDurationLanguage");var Wo=Object.defineProperty,Ho=m((t,e)=>Wo(t,"name",{value:e,configurable:!0}),"b$5"),zo=Object.defineProperty,Vo=Ho((t,e)=>zo(t,"name",{value:e,configurable:!0}),"b"),Ko=Object.defineProperty,$t=Vo((t,e)=>Ko(t,"name",{value:e,configurable:!0}),"g");const Vs=$t((t,e)=>{e=e||-1;const r=new RegExp(String.raw`^-?\d+(?:\.\d{0,${String(e)}})?`).exec(t.toString());return r===null?t:Number.parseFloat(r[0])},"toFixed"),gs=$t(({unitCount:t,unitName:e},r,s)=>{let{spacer:i}=s;const{maxDecimalPoints:o}=s;let n=".";s.decimal!==void 0?n=s.decimal:r.decimal!==void 0&&(n=r.decimal);let c;"digitReplacements"in s?c=s.digitReplacements:"_digitReplacements"in r&&(c=r._digitReplacements);let u,h=t;o!==void 0&&(h=Vs(t,o));const f=h.toString();if(!r._hideCountIf2||t!==2)if(c){u="";for(const g of f)u+=g==="."?n:c[g]}else u=f.replace(".",n);else u="";const p=r[e];let l=p;return typeof p=="function"&&(l=p(t)),r._hideCountIf2&&t===2&&(i=""),r._numberFirst?l+i+u:u+i+l},"renderPiece"),Yo=$t((t,e)=>{const{units:r}=e;if(r.length===0)return[];const{unitMeasures:s}=e,i=e.largest??Number.POSITIVE_INFINITY,o={};let n,c,u,h=t;for(c=0;c<r.length;c++){n=r[c];const p=s[n];u=c===r.length-1?h/p:Math.floor(h/p),o[n]=u,h-=u*p}if(e.round){let p=i;for(c=0;c<r.length;c++)if(n=r[c],u=o[n],u!==0&&(p--,p===0)){for(let l=c+1;l<r.length;l++){const g=r[l],w=o[g];o[n]=(o[n]??0)+w*s[g]/s[n],o[g]=0}break}for(c=r.length-1;c>=0;c--){if(n=r[c],u=o[n],u===0)continue;const l=Math.round(u);if(o[n]=l,c===0)break;const g=r[c-1],w=s[g],I=Math.floor(l*s[n]/w);if(I)o[g]=(o[g]??0)+I,o[n]=0;else break}}const f=[];for(c=0;c<r.length&&f.length<i;c++){if(n=r[c],u=o[n],u&&!e.round&&f.length===i-1){let p,l=0;for(p=c+1,r.length;p<r.length;p++){const g=r[p];l+=o[g]*(e.unitMeasures[g]/e.unitMeasures[n])}u+=l,e.maxDecimalPoints!==void 0&&(u=Vs(u,e.maxDecimalPoints))}u&&f.push({unitCount:u,unitName:n})}return f},"getPieces"),Jo=$t((t,e,r)=>{const{language:s,units:i}=e;if(t.length===0){const p=i.at(-1);return gs({unitCount:0,unitName:p},s,e)}const{conjunction:o,serialComma:n}=e;let c=", ";e.delimiter!==void 0?c=e.delimiter:s.delimiter!==void 0&&(c=s.delimiter);let u="";e.timeAdverb&&r!==0&&(u=s.future??"",r<0&&(u=s.past??""));const h=t.map(p=>gs(p,s,e));let f;return!o||t.length===1?f=h.join(c):t.length===2?f=h.join(o):f=h.slice(0,-1).join(c)+(n?",":"")+o+(h.at(-1)??""),u&&(f=u.replace("%s",f)),f},"formatPieces"),Ks=$t((t,e)=>{if(Number.isNaN(t))throw new TypeError("Expected a valid number");if(typeof t!="number")throw new TypeError("Expected a number for milliseconds input");const r={conjunction:"",language:Lo,round:!1,serialComma:!0,spacer:" ",timeAdverb:!1,unitMeasures:{d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},units:["w","d","h","m","s"],...e};Uo(r.language);const s=Math.abs(t),i=Yo(s,r);return Jo(i,r,t)},"duration");var Xo=Object.defineProperty,Ys=m((t,e)=>Xo(t,"name",{value:e,configurable:!0}),"a$4"),Qo=Object.defineProperty,fr=Ys((t,e)=>Qo(t,"name",{value:e,configurable:!0}),"u"),Zo=Object.defineProperty,ea=fr((t,e)=>Zo(t,"name",{value:e,configurable:!0}),"e");function _t({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}m(_t,"u$4");Ys(_t,"a");fr(_t,"t");ea(_t,"ansiRegex");var ta=Object.defineProperty,ra=fr((t,e)=>ta(t,"name",{value:e,configurable:!0}),"r");const sa=_t(),na=/\]0;[\s\S]*?/g,ia=ra(t=>t.replace(na,"").replace(sa,""),"strip");var oa=Object.defineProperty,De=m((t,e)=>oa(t,"name",{value:e,configurable:!0}),"t$2");const Me="@voidzero-dev/vite-task-client",hr="@visulima/task-runner-client",Pt=`npm:${hr}@^1`,Js=he(".vis",".vite-client-override-declined"),Ft="pnpm-workspace.yaml",aa=["dependencies","devDependencies","optionalDependencies","peerDependencies"],Xs=De(t=>{try{return JSON.parse(at(t,"utf8"))}catch{return}},"readPackageJson"),ca=De(t=>{const e=he(t,Ft);if(Ze(e))try{return _s(at(e,"utf8")).toJS()?.overrides}catch{return}},"readPnpmWorkspaceOverrides"),la=De(t=>t==="pnpm"||t==="aube"?"pnpm.overrides":t==="yarn"?"resolutions":"overrides","overrideFieldFor"),da=De(t=>{const e=he(t,Ft);try{const r=_s(at(e,"utf8"));return r.setIn(["overrides",Me],Pt),cr(e,r.toString()),!0}catch{return!1}},"writeToPnpmWorkspaceYaml"),ms=De(t=>t!==void 0&&aa.some(e=>t[e]?.[Me]!==void 0),"isDependency"),ua=De((t,e)=>t!==void 0&&(t.pnpm?.overrides?.[Me]!==void 0||t.overrides?.[Me]!==void 0||t.resolutions?.[Me]!==void 0)||e?.[Me]!==void 0,"isAlreadyOverridden"),fa=De((t,e=[])=>{const r=Xs(he(t,"package.json")),s=Ze(he(t,"node_modules","@voidzero-dev","vite-task-client"));return{alreadyOverridden:ua(r,ca(t)),declined:Ze(he(t,Js)),manager:zi(t)?.manager,present:ms(r)||s||e.some(i=>ms(i))}},"detectViteClientOverride"),ha=De(t=>{try{const e=he(t,Js);Ki(li(e),{recursive:!0}),cr(e,`Declined adding the ${Me} → ${hr} override.
1
+ var oi=Object.defineProperty;var m=(t,e)=>oi(t,"name",{value:e,configurable:!0});import{createRequire as ai}from"node:module";import{M as he,K as li,Q as di,B as ui}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{bR as _s,w as K,a5 as a,a6 as $,n as d,bS as fi,d as $e,R as te,aG as Gs,aI as hi,aF as pi,af as is,aJ as gi,aK as mi,k as vi,O as Bt,P as or,bT as wi,bU as yi,E as Et,bV as $i,M as xi,C as bi,S as ki,bW as ji,bX as Si,s as pt,bY as Ti,aM as Ci,bZ as Ii,b_ as Ri,b$ as Oi,c0 as Ei,W as Mi,c1 as Pi}from"./bin.js";import{buildEnhancedPath as Fi,runConcurrently as Mt,TerminalBuffer as ar,readLastRunSummary as Ai,getLastRunSummaryPath as Li,enforceProjectConstraints as Di,expandTokensInString as os,parsePartition as Bi,TaskScheduler as Ni,createTaskGraph as _i,reverseTaskGraph as Gi,generateRunSummary as as,writeChromeTrace as qi,resolveTurboEnvCompat as Ui,CompositeLifeCycle as cs,defaultTaskRunner as ls,createLogReporter as Wi,writeRunSummary as Hi}from"@visulima/task-runner";import{d as zi,r as Vi}from"../packem_shared/lockfile-Cu2BH6bl.js";import{F as eo}from"../packem_shared/failure-log-34Wl3npC.js";import{r as to}from"../packem_shared/toolchain-DoG6b_G_.js";import{i as ro,a as so,b as no,s as io,d as oo,c as ao,r as co,H as lo,f as uo,e as fo}from"../packem_shared/lifecycle-CXaqPGAQ.js";import{p as ho,r as po,f as go}from"../packem_shared/selectors-DkgYFzdq.js";import{T as Us,C as lr,D as Nt,E as Ws}from"../packem_shared/symbols-CQmER5MT.js";import{q as $o,j as xo,T as Vt,E as fs}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{n as Hs}from"../packem_shared/spinner-C8xs6QZv.js";import{c as hs,a as To,s as ps}from"../packem_shared/watch-DEL0yol9.js";import{E as zs}from"./config.js";const ci=ai(import.meta.url),ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=m(t=>{if(typeof ht<"u"&&ht.versions&&ht.versions.node){const[e,r]=ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ht.getBuiltinModule(t)}return ci(t)},"__cjs_getBuiltinModule"),{readFileSync:at,existsSync:Ze,writeFileSync:cr,mkdirSync:Ki,openSync:Yi,statSync:ds,readSync:Ji,closeSync:Xi,mkdtempSync:Qi}=_e("node:fs"),{createInterface:qs,emitKeypressEvents:Zi}=_e("node:readline"),{isAbsolute:mo,resolve:us,dirname:vo,relative:wo}=_e("node:path"),{fileURLToPath:yo}=_e("node:url"),{createRequire:bo}=_e("node:module"),{createHash:ko}=_e("node:crypto"),{appendFile:dr}=_e("node:fs/promises"),{platform:jo,homedir:ur,tmpdir:So}=_e("node:os"),{spawn:Co}=_e("node:child_process");var Io=Object.defineProperty,Ro=m((t,e)=>Io(t,"name",{value:e,configurable:!0}),"u$5"),Oo=Object.defineProperty,Eo=Ro((t,e)=>Oo(t,"name",{value:e,configurable:!0}),"v"),Mo=Object.defineProperty,Po=Eo((t,e)=>Mo(t,"name",{value:e,configurable:!0}),"D");const Fo=Po((t,e,r,s,i,o,n,c,u,h,f,p,l,g)=>{const w={d:s,h:i,m:o,mo:e,ms:c,s:n,w:r,y:t};return u!==void 0&&(w.future=u),h!==void 0&&(w.past=h),f!==void 0&&(w.decimal=f),p!==void 0&&(w.unitMap=p),l!==void 0&&(w.groupSeparator=l),g!==void 0&&(w.placeholderSeparator=g),w},"createDurationLanguage"),Ao={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},Lo=Fo(t=>`year${t===1?"":"s"}`,t=>`month${t===1?"":"s"}`,t=>`week${t===1?"":"s"}`,t=>`day${t===1?"":"s"}`,t=>`hour${t===1?"":"s"}`,t=>`minute${t===1?"":"s"}`,t=>`second${t===1?"":"s"}`,t=>`millisecond${t===1?"":"s"}`,"in %s","%s ago",".",Ao,",","_");var Do=Object.defineProperty,Bo=m((t,e)=>Do(t,"name",{value:e,configurable:!0}),"o$4"),No=Object.defineProperty,_o=Bo((t,e)=>No(t,"name",{value:e,configurable:!0}),"o"),Go=Object.defineProperty,qo=_o((t,e)=>Go(t,"name",{value:e,configurable:!0}),"o");const Uo=qo(t=>{const e=["y","mo","w","d","h","m","s","ms","future","past"];for(const s of e)if(!Object.hasOwn(t,s))throw new TypeError(`Missing required property: ${s}`);if(typeof t.future!="string"||typeof t.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const s of r)if(typeof t[s]!="string"&&typeof t[s]!="function")throw new TypeError(`Property ${s} must be of type string or function`);if(t.decimal&&typeof t.decimal!="string")throw new TypeError("Property decimal must be of type string");if(t.delimiter&&typeof t.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(t._digitReplacements&&!Array.isArray(t._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(t._numberFirst&&typeof t._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(t.unitMap&&typeof t.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(t.unitMap&&Object.values(t.unitMap).some(s=>typeof s!="string"))throw new TypeError("All values in unitMap must be of type string")},"validateDurationLanguage");var Wo=Object.defineProperty,Ho=m((t,e)=>Wo(t,"name",{value:e,configurable:!0}),"b$5"),zo=Object.defineProperty,Vo=Ho((t,e)=>zo(t,"name",{value:e,configurable:!0}),"b"),Ko=Object.defineProperty,$t=Vo((t,e)=>Ko(t,"name",{value:e,configurable:!0}),"g");const Vs=$t((t,e)=>{e=e||-1;const r=new RegExp(String.raw`^-?\d+(?:\.\d{0,${String(e)}})?`).exec(t.toString());return r===null?t:Number.parseFloat(r[0])},"toFixed"),gs=$t(({unitCount:t,unitName:e},r,s)=>{let{spacer:i}=s;const{maxDecimalPoints:o}=s;let n=".";s.decimal!==void 0?n=s.decimal:r.decimal!==void 0&&(n=r.decimal);let c;"digitReplacements"in s?c=s.digitReplacements:"_digitReplacements"in r&&(c=r._digitReplacements);let u,h=t;o!==void 0&&(h=Vs(t,o));const f=h.toString();if(!r._hideCountIf2||t!==2)if(c){u="";for(const g of f)u+=g==="."?n:c[g]}else u=f.replace(".",n);else u="";const p=r[e];let l=p;return typeof p=="function"&&(l=p(t)),r._hideCountIf2&&t===2&&(i=""),r._numberFirst?l+i+u:u+i+l},"renderPiece"),Yo=$t((t,e)=>{const{units:r}=e;if(r.length===0)return[];const{unitMeasures:s}=e,i=e.largest??Number.POSITIVE_INFINITY,o={};let n,c,u,h=t;for(c=0;c<r.length;c++){n=r[c];const p=s[n];u=c===r.length-1?h/p:Math.floor(h/p),o[n]=u,h-=u*p}if(e.round){let p=i;for(c=0;c<r.length;c++)if(n=r[c],u=o[n],u!==0&&(p--,p===0)){for(let l=c+1;l<r.length;l++){const g=r[l],w=o[g];o[n]=(o[n]??0)+w*s[g]/s[n],o[g]=0}break}for(c=r.length-1;c>=0;c--){if(n=r[c],u=o[n],u===0)continue;const l=Math.round(u);if(o[n]=l,c===0)break;const g=r[c-1],w=s[g],I=Math.floor(l*s[n]/w);if(I)o[g]=(o[g]??0)+I,o[n]=0;else break}}const f=[];for(c=0;c<r.length&&f.length<i;c++){if(n=r[c],u=o[n],u&&!e.round&&f.length===i-1){let p,l=0;for(p=c+1,r.length;p<r.length;p++){const g=r[p];l+=o[g]*(e.unitMeasures[g]/e.unitMeasures[n])}u+=l,e.maxDecimalPoints!==void 0&&(u=Vs(u,e.maxDecimalPoints))}u&&f.push({unitCount:u,unitName:n})}return f},"getPieces"),Jo=$t((t,e,r)=>{const{language:s,units:i}=e;if(t.length===0){const p=i.at(-1);return gs({unitCount:0,unitName:p},s,e)}const{conjunction:o,serialComma:n}=e;let c=", ";e.delimiter!==void 0?c=e.delimiter:s.delimiter!==void 0&&(c=s.delimiter);let u="";e.timeAdverb&&r!==0&&(u=s.future??"",r<0&&(u=s.past??""));const h=t.map(p=>gs(p,s,e));let f;return!o||t.length===1?f=h.join(c):t.length===2?f=h.join(o):f=h.slice(0,-1).join(c)+(n?",":"")+o+(h.at(-1)??""),u&&(f=u.replace("%s",f)),f},"formatPieces"),Ks=$t((t,e)=>{if(Number.isNaN(t))throw new TypeError("Expected a valid number");if(typeof t!="number")throw new TypeError("Expected a number for milliseconds input");const r={conjunction:"",language:Lo,round:!1,serialComma:!0,spacer:" ",timeAdverb:!1,unitMeasures:{d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},units:["w","d","h","m","s"],...e};Uo(r.language);const s=Math.abs(t),i=Yo(s,r);return Jo(i,r,t)},"duration");var Xo=Object.defineProperty,Ys=m((t,e)=>Xo(t,"name",{value:e,configurable:!0}),"a$4"),Qo=Object.defineProperty,fr=Ys((t,e)=>Qo(t,"name",{value:e,configurable:!0}),"u"),Zo=Object.defineProperty,ea=fr((t,e)=>Zo(t,"name",{value:e,configurable:!0}),"e");function _t({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}m(_t,"u$4");Ys(_t,"a");fr(_t,"t");ea(_t,"ansiRegex");var ta=Object.defineProperty,ra=fr((t,e)=>ta(t,"name",{value:e,configurable:!0}),"r");const sa=_t(),na=/\]0;[\s\S]*?/g,ia=ra(t=>t.replace(na,"").replace(sa,""),"strip");var oa=Object.defineProperty,De=m((t,e)=>oa(t,"name",{value:e,configurable:!0}),"t$2");const Me="@voidzero-dev/vite-task-client",hr="@visulima/task-runner-client",Pt=`npm:${hr}@^1`,Js=he(".vis",".vite-client-override-declined"),Ft="pnpm-workspace.yaml",aa=["dependencies","devDependencies","optionalDependencies","peerDependencies"],Xs=De(t=>{try{return JSON.parse(at(t,"utf8"))}catch{return}},"readPackageJson"),ca=De(t=>{const e=he(t,Ft);if(Ze(e))try{return _s(at(e,"utf8")).toJS()?.overrides}catch{return}},"readPnpmWorkspaceOverrides"),la=De(t=>t==="pnpm"||t==="aube"?"pnpm.overrides":t==="yarn"?"resolutions":"overrides","overrideFieldFor"),da=De(t=>{const e=he(t,Ft);try{const r=_s(at(e,"utf8"));return r.setIn(["overrides",Me],Pt),cr(e,r.toString()),!0}catch{return!1}},"writeToPnpmWorkspaceYaml"),ms=De(t=>t!==void 0&&aa.some(e=>t[e]?.[Me]!==void 0),"isDependency"),ua=De((t,e)=>t!==void 0&&(t.pnpm?.overrides?.[Me]!==void 0||t.overrides?.[Me]!==void 0||t.resolutions?.[Me]!==void 0)||e?.[Me]!==void 0,"isAlreadyOverridden"),fa=De((t,e=[])=>{const r=Xs(he(t,"package.json")),s=Ze(he(t,"node_modules","@voidzero-dev","vite-task-client"));return{alreadyOverridden:ua(r,ca(t)),declined:Ze(he(t,Js)),manager:zi(t)?.manager,present:ms(r)||s||e.some(i=>ms(i))}},"detectViteClientOverride"),ha=De(t=>{try{const e=he(t,Js);Ki(li(e),{recursive:!0}),cr(e,`Declined adding the ${Me} → ${hr} override.
2
2
  Delete this file to be asked again.
3
3
  `)}catch{}},"recordDecline"),pa=De((t,e="npm")=>{const r=`${e} install`;if((e==="pnpm"||e==="aube")&&Ze(he(t,Ft))&&da(t))return{file:Ft,installCommand:r};const s=he(t,"package.json"),i=Xs(s);if(!i)return;const o=la(e);o==="pnpm.overrides"?(i.pnpm??={},i.pnpm.overrides??={},i.pnpm.overrides[Me]=Pt):(i[o]??={},i[o][Me]=Pt);try{cr(s,`${JSON.stringify(i,void 0,4)}
4
4
  `)}catch{return}return{file:"package.json",installCommand:r}},"applyViteClientOverride"),ga=De(async(t,e)=>{const r=fa(t,e.projectManifests);if(!r.present||r.alreadyOverridden||r.declined||!e.interactive)return!1;const s=qs({input:process.stdin,output:process.stdout});try{e.logger.info(`Detected ${Me}. Its cache hints no-op under @visulima/task-runner unless aliased to ${hr} (a drop-in replacement).`);const i=await new Promise(n=>{s.question("Add the override now? [y/N] ",n)});if(!/^y(?:es)?$/i.test(i.trim()))return ha(t),e.logger.info("Skipped. Delete .vis/.vite-client-override-declined to be asked again."),!1;const o=pa(t,r.manager);return o===void 0?(e.logger.warn("Could not write the override automatically — add it manually (see @visulima/task-runner-client README)."),!1):(e.logger.info(`Added "${Me}": "${Pt}" to ${o.file}. Run \`${o.installCommand}\` to apply it.`),!0)}finally{s.close()}},"maybePromptViteClientOverride");var ma=Object.defineProperty,va=m((t,e)=>ma(t,"name",{value:e,configurable:!0}),"t$1");const wa=va(({interactive:t,taskPty:e,workspacePty:r})=>e===!0?!0:e===!1?!1:t&&r!==!1,"decidePty");var ya=Object.defineProperty,Qs=m((t,e)=>ya(t,"name",{value:e,configurable:!0}),"f$8");const $a=Qs(t=>t.split(",").map(e=>e.trim()).filter(e=>e!==""),"splitPatterns"),xa=Qs((t,e,r)=>{const s=new Set,i=[];if(t===void 0||t.trim()==="")return{skipTaskIds:s,unmatchedPatterns:i};const o=[...r],n=new Set(o),c=new Map;for(const u of o){const h=u.lastIndexOf(":");if(h===-1)continue;const f=u.slice(h+1),p=c.get(f);p===void 0?c.set(f,[u]):p.push(u)}for(const u of $a(t)){if(u.startsWith("~:"))throw new Error(`--skip-cache does not support the closest-project selector "~:" (received "${u}"). Use \`pkg:target\`, \`:target\`, or \`#tag:target\`.`);if(n.has(u)){s.add(u);continue}const h=ho(u);if(!h){i.push(u);continue}let f=!1;switch(h.kind){case"all":{const p=c.get(h.target)??[];for(const l of p)s.add(l),f=!0;break}case"project":{const p=h.projects?.[0];if(p!==void 0){const l=`${p}:${h.target}`;n.has(l)&&(s.add(l),f=!0)}break}case"tag":{const{tag:p}=h;if(p!==void 0){const l=c.get(h.target)??[];for(const g of l){const w=g.slice(0,g.lastIndexOf(":"));e.projects[w]?.tags?.includes(p)===!0&&(s.add(g),f=!0)}}break}}f||i.push(u)}return{skipTaskIds:s,unmatchedPatterns:i}},"resolveSkipCachePatterns");var ba=Object.defineProperty,pr=m((t,e)=>ba(t,"name",{value:e,configurable:!0}),"a$3");const ka=/\$(?:\{([A-Z_]\w*)(:-[^}]*)?\}|([A-Z_]\w*))/gi,ja=new Set(["0","!","#","$","*","-","?","@","_"]),Sa=pr(t=>{const e=new Map;for(const r of t.matchAll(ka)){const s=r[1],i=r[3],o=r[2],n=s??i;if(n===void 0||ja.has(n))continue;const c=o!==void 0,u=e.get(n);u===void 0?e.set(n,c):u&&!c&&e.set(n,!1)}return[...e.entries()].map(([r,s])=>({hasDefault:s,name:r}))},"extractEnvReferences"),Ta=pr(t=>{const{command:e,processEnv:r,taskEnv:s,taskId:i}=t,o=Sa(e);if(o.length===0)return;const n=[];for(const{hasDefault:c,name:u}of o){if(c)continue;const h=s[u],f=r[u];h===void 0&&f===void 0&&n.push(u)}if(n.length!==0)return{missing:n.toSorted(),taskId:i}},"checkStrictEnv"),Ca=pr(t=>{const e=t.missing.map(r=>`$${r}`).join(", ");return`Strict env: ${t.taskId} references unset variable${t.missing.length===1?"":"s"} ${e}. Set ${t.missing.length===1?"it":"them"} in the task env, an envFile, or the parent shell — or opt out with options.strictEnv: false.`},"formatStrictEnvError");var Ia=Object.defineProperty,ze=m((t,e)=>Ia(t,"name",{value:e,configurable:!0}),"i$5");const vs=ze(t=>{const e=new Set;for(const r of Object.values(t.projects))for(const s of Object.keys(r.targets??{}))e.add(s);return[...e].sort()},"collectAvailableTargets"),Ra=ze(t=>{const e=new Map;for(const r of t.values())for(const[s,i]of Object.entries(r))for(const o of i.aliases??[])e.has(o)||e.set(o,s);return e},"buildAliasMap"),Oa=ze((t,e)=>e.get(t)??t,"resolveTargetAlias"),Ea=ze((t,e)=>{if(t.length===0)return e.length;if(e.length===0)return t.length;const r=[];for(let s=0;s<=e.length;s++)r[s]=[s];for(let s=0;s<=t.length;s++)r[0][s]=s;for(let s=1;s<=e.length;s++)for(let i=1;i<=t.length;i++){const o=e[s-1]===t[i-1]?0:1;r[s][i]=Math.min(r[s-1][i]+1,r[s][i-1]+1,r[s-1][i-1]+o)}return r[e.length][t.length]},"levenshtein"),Ma=ze((t,e,r=3)=>Zs(t,e,1,r)[0],"suggestTarget"),Zs=ze((t,e,r=3,s=3)=>{const i=[];for(const o of e){const n=Ea(t.toLowerCase(),o.toLowerCase());n<=s&&i.push({distance:n,name:o})}return i.sort((o,n)=>o.distance-n.distance||o.name.localeCompare(n.name)),i.slice(0,r).map(o=>o.name)},"suggestTargets"),Pa=ze(t=>t.length===0?" (no targets found)":t.map(e=>` - ${e}`).join(`
@@ -1,4 +1,4 @@
1
- var Tc=Object.defineProperty;var l=(e,t)=>Tc(e,"name",{value:t,configurable:!0});import{createRequire as Ic}from"node:module";import{E as _e,q as Ec,e as vr,T as Hc,I as pu}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{a as Jt,z as Xa,i as Ya,$ as Gc,C as Lt,M as cn}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{fingerprint as zt,listRules as fu,listRequiredValidators as Fc,scan as gu,scanFiles as Vc,inspectRuleset as zc}from"@visulima/secret-scanner";import{c4 as Sc,c5 as qo,p as Pe}from"./bin.js";import{$ as _r}from"../packem_shared/spinners-f91Rbo99-Bjf3NcO0.js";import{n as Mc,q as Lc}from"./config.js";const Dc=Ic(import.meta.url),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Za=l(e=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[t,n]=Xt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Xt.getBuiltinModule(e)}return Dc(e)},"__cjs_getBuiltinModule"),{createRequire:Bc}=Za("node:module"),{pathToFileURL:mu}=Za("node:url"),{execFileSync:Kc}=Za("node:child_process");var Jc=Object.defineProperty,eo=l((e,t)=>Jc(e,"name",{value:t,configurable:!0}),"n$17"),Wc=Object.defineProperty,br=eo((e,t)=>Wc(e,"name",{value:t,configurable:!0}),"h");const qc=Bc(import.meta.url),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rc=br(e=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[t,n]=Yt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Yt.getBuiltinModule(e)}return qc(e)},"__cjs_getBuiltinModule"),{styleText:Uc}=Rc("node:util");var Qc=Object.defineProperty,to=br((e,t)=>Qc(e,"name",{value:t,configurable:!0}),"r");const _c={error:"✖",info:"ℹ",success:"✓",warning:"⚠"},Zc=to(e=>{const t=[];return e.bold&&t.push("bold"),e.dim&&t.push("dim"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),e.strikethrough&&t.push("strikethrough"),e.color&&t.push(e.color),e.bgColor&&t.push(e.bgColor),t.length===0?n=>n:n=>Uc(t,n)},"resolveStyleToFunction");let vu=class{static{l(this,"a")}static{eo(this,"m")}static{br(this,"Spinner")}static{to(this,"Spinner")}#t=0;#o;#e=!1;#r="";#i="";#f=0;#d=0;#a;#n;#h="";#l;#p;#s;#g;constructor(t={},n){this.#l=t.name??"dots",this.#p=t.verbose!==!1,this.#r=t.prefixText??"",this.#a=n,this.#g={..._c,...t.icons},typeof t.style=="function"?this.#s=t.style:t.style&&(this.#s=Zc(t.style))}get elapsedTime(){return(this.#d||Date.now())-this.#f}get text(){return this.#i}get getText(){return this.#i}set text(t){this.#i=t,this.#e&&(this.#n?this.#n.renderAll():this.#a&&this.#u())}get prefixText(){return this.#r}get getPrefixText(){return this.#r}set prefixText(t){this.#r=t,this.#e&&(this.#n?this.#n.renderAll():this.#a&&this.#u())}get isRunning(){return this.#e}setInteractiveManager(t){this.#a=t}setMultiSpinner(t){this.#n=t}start(t,n){if(this.#e)return this;if(!this.#p)return this;this.#e=!0,this.#f=Date.now(),this.#d=0,this.#t=0,t&&(this.#i=t),n?.prefixText&&(this.#r=n.prefixText);const r=this.#n??this.#a;r&&(this.#n?r.renderAll():(r.hook(),this.#u()));const a=_r(this.#l);return this.#o=setInterval(()=>{this.#e&&(this.#t=(this.#t+1)%a.frames.length,this.#n?this.#n.renderAll():this.#a&&this.#u())},a.interval),this}succeed(t){this.#c("success",t)}failed(t){this.#c("error",t)}warn(t){this.#c("warning",t)}info(t){this.#c("info",t)}pause(){this.#o&&(clearInterval(this.#o),this.#o=void 0)}resume(){if(!this.#e)return;this.#o&&clearInterval(this.#o);const t=_r(this.#l);this.#o=setInterval(()=>{this.#e&&(this.#t=(this.#t+1)%t.frames.length,this.#n?this.#n.renderAll():this.#a&&this.#u())},t.interval)}getFrameOutput(){if(!this.#e&&this.#h)return this.#h;const t=_r(this.#l).frames[this.#t];let n=this.#s?this.#s(t):t;return this.#r&&(n=`${this.#r} ${n}`),this.#i&&(n=`${n} ${this.#i}`),n}#u(){this.#a&&this.#a.update("stdout",[this.getFrameOutput()])}#c(t,n){if(!this.#e||(this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#e=!1,this.#d=Date.now(),!this.#p))return;let r="";const a=this.#g[t];a&&(r=this.#s?this.#s(a):a),this.#r&&(r=`${this.#r} ${r}`),n&&(r=`${r} ${n}`),this.#h=r,(this.#n??this.#a)&&(this.#n?this.#n.renderAll():this.#a&&(this.#a.update("stdout",[r]),this.#a.unhook(!1)))}},DN=class{static{l(this,"T")}static{eo(this,"b")}static{br(this,"MultiSpinner")}static{to(this,"MultiSpinner")}#t=new Map;#o=0;#e;#r=!1;#i;constructor(t={},n){this.#i=t,this.#e=n}setInteractiveManager(t){this.#e=t}create(t,n={}){const r=`spinner_${String(this.#o++)}`,a=new vu({...this.#i,...n});return a.setMultiSpinner(this),this.#t.set(r,a),t&&(a.text=t),a}remove(t){for(const[n,r]of this.#t.entries())if(r===t)return this.#t.delete(n),this.renderAll(),!0;return!1}stop(){for(const t of this.#t.values())t.succeed();this.#t.clear(),this.#r=!1,this.#e&&this.#e.unhook(!1)}clear(){for(const t of this.#t.values())t.succeed();this.#t.clear()}renderAll(){if(!this.#e)return;this.#r||(this.#r=!0,this.#e.hook());const t=[];for(const n of this.#t.values())t.push(n.getFrameOutput());t.length>0&&this.#e.update("stdout",t)}};const Xc={one:{},two:{},three:{},four:{}},Yc={one:{},two:{},three:{}},ed={},td=[],$a={methods:Xc,model:Yc,compute:ed,hooks:td};var nd=Object.defineProperty,bu=l((e,t)=>nd(e,"name",{value:t,configurable:!0}),"s$1o");const rd=bu(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),ad={compute:bu(function(e){const{world:t}=this,n=t.compute;return typeof e=="string"&&n.hasOwnProperty(e)?n[e](this):rd(e)?e.forEach(r=>{t.compute.hasOwnProperty(r)?n[r](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this},"compute")};var od=Object.defineProperty,qt=l((e,t)=>od(e,"name",{value:t,configurable:!0}),"o$1V");const id=qt(function(e){return this.fullPointer.forEach((t,n)=>{const r=this.update([t]);e(r,n)}),this},"forEach"),sd=qt(function(e,t){const n=this.fullPointer.map((a,o)=>{const i=this.update([a]),s=e(i,o);return s===void 0?this.none():s});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let r=[];return n.forEach(a=>{r=r.concat(a.fullPointer)}),this.toView(r)},"map"),ud=qt(function(e){let t=this.fullPointer;return t=t.filter((n,r)=>{const a=this.update([n]);return e(a,r)}),this.update(t)},"filter"),ld=qt(function(e){const t=this.fullPointer.find((n,r)=>{const a=this.update([n]);return e(a,r)});return this.update([t])},"find"),cd=qt(function(e){return this.fullPointer.some((t,n)=>{const r=this.update([t]);return e(r,n)})},"some"),dd=qt(function(e=1){let t=this.fullPointer,n=Math.floor(Math.random()*t.length);return n+e>this.length&&(n=this.length-e,n=n<0?0:n),t=t.slice(n,n+e),this.update(t)},"random"),hd={forEach:id,map:sd,filter:ud,find:ld,some:cd,random:dd};var pd=Object.defineProperty,Y=l((e,t)=>pd(e,"name",{value:t,configurable:!0}),"r$1p");const Ie={termList:Y(function(){return this.methods.one.termList(this.docs)},"termList"),terms:Y(function(e){const t=this.match(".");return typeof e=="number"?t.eq(e):t},"terms"),groups:Y(function(e){if(e||e===0)return this.update(this._groups[e]||[]);const t={};return Object.keys(this._groups).forEach(n=>{t[n]=this.update(this._groups[n])}),t},"groups"),eq:Y(function(e){let t=this.pointer;return t||(t=this.docs.map((n,r)=>[r])),t[e]?this.update([t[e]]):this.none()},"eq"),first:Y(function(){return this.eq(0)},"first"),last:Y(function(){const e=this.fullPointer.length-1;return this.eq(e)},"last"),firstTerms:Y(function(){return this.match("^.")},"firstTerms"),lastTerms:Y(function(){return this.match(".$")},"lastTerms"),slice:Y(function(e,t){let n=this.pointer||this.docs.map((r,a)=>[a]);return n=n.slice(e,t),this.update(n)},"slice"),all:Y(function(){return this.update().toView()},"all"),fullSentences:Y(function(){const e=this.fullPointer.map(t=>[t[0]]);return this.update(e).toView()},"fullSentences"),none:Y(function(){return this.update([])},"none"),isDoc:Y(function(e){if(!e||!e.isView)return!1;const t=this.fullPointer,n=e.fullPointer;return!t.length===n.length?!1:t.every((r,a)=>n[a]?r[0]===n[a][0]&&r[1]===n[a][1]&&r[2]===n[a][2]:!1)},"isDoc"),wordCount:Y(function(){return this.docs.reduce((e,t)=>(e+=t.filter(n=>n.text!=="").length,e),0)},"wordCount"),isFull:Y(function(){const e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,n=0;return this.document.forEach(r=>t+=r.length),this.docs.forEach(r=>n+=r.length),t===n},"isFull"),getNth:Y(function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this},"getNth")};Ie.group=Ie.groups;Ie.fullSentence=Ie.fullSentences;Ie.sentence=Ie.fullSentences;Ie.lastTerm=Ie.lastTerms;Ie.firstTerm=Ie.firstTerms;const wa=Object.assign({},Ie,ad,hd);wa.get=wa.eq;var fd=Object.defineProperty,gd=l((e,t)=>fd(e,"name",{value:t,configurable:!0}),"l$1p");let yr=class ar{static{l(this,"h")}static{gd(this,"View")}constructor(t,n,r={}){[["document",t],["world",$a],["_groups",r],["_cache",null],["viewType","View"]].forEach(a=>{Object.defineProperty(this,a[0],{value:a[1],writable:!0})}),this.ptrs=n}get docs(){let t=this.document;return this.ptrs&&(t=$a.methods.one.getDoc(this.ptrs,this.document)),t}get pointer(){return this.ptrs}get methods(){return this.world.methods}get model(){return this.world.model}get hooks(){return this.world.hooks}get isView(){return!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){const{docs:t,ptrs:n,document:r}=this;return(n||t.map((a,o)=>[o])).map(a=>{let[o,i,s,u,c]=a;return i=i||0,s=s||(r[o]||[]).length,r[o]&&r[o][i]&&(u=u||r[o][i].id,r[o][s-1]&&(c=c||r[o][s-1].id)),[o,i,s,u,c]})}update(t){const n=new ar(this.document,t);if(this._cache&&t&&t.length>0){const r=[];t.forEach((a,o)=>{const[i,s,u]=a;a.length===1?r[o]=this._cache[i]:s===0&&this.document[i].length===u&&(r[o]=this._cache[i])}),r.length>0&&(n._cache=r)}return n.world=this.world,n}toView(t){return new ar(this.document,t||this.pointer)}fromText(t){const{methods:n}=this,r=n.one.tokenize.fromString(t,this.world),a=new ar(r);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(r=>r.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));const n=this.update(this.pointer);return n.document=t,n._cache=this._cache,n}};Object.assign(yr.prototype,wa);const md="14.15.0";var vd=Object.defineProperty,Rt=l((e,t)=>vd(e,"name",{value:t,configurable:!0}),"a$1R");const Ro=Rt(function(e){return e&&typeof e=="object"&&!Array.isArray(e)},"isObject"),bd=Rt(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray");function no(e,t){if(Ro(t))for(const n in t)Ro(t[n])?(e[n]||Object.assign(e,{[n]:{}}),no(e[n],t[n])):Object.assign(e,{[n]:t[n]});return e}l(no,"c$1M");Rt(no,"mergeDeep");function yu(e,t){for(const n in t)e[n]=e[n]||{},Object.assign(e[n],t[n]);return e}l(yu,"h$1s");Rt(yu,"mergeQuick");const yd=Rt(function(e,t){const n=e.two.models||{};Object.keys(t).forEach(r=>{t[r].pastTense&&(n.toPast&&(n.toPast.ex[r]=t[r].pastTense),n.fromPast&&(n.fromPast.ex[t[r].pastTense]=r)),t[r].presentTense&&(n.toPresent&&(n.toPresent.ex[r]=t[r].presentTense),n.fromPresent&&(n.fromPresent.ex[t[r].presentTense]=r)),t[r].gerund&&(n.toGerund&&(n.toGerund.ex[r]=t[r].gerund),n.fromGerund&&(n.fromGerund.ex[t[r].gerund]=r)),t[r].comparative&&(n.toComparative&&(n.toComparative.ex[r]=t[r].comparative),n.fromComparative&&(n.fromComparative.ex[t[r].comparative]=r)),t[r].superlative&&(n.toSuperlative&&(n.toSuperlative.ex[r]=t[r].superlative),n.fromSuperlative&&(n.fromSuperlative.ex[t[r].superlative]=r))})},"addIrregulars"),$u=Rt(function(e,t,n,r){if(bd(e)){e.forEach(u=>$u(u,t,n,r));return}const{methods:a,model:o,compute:i,hooks:s}=t;e.methods&&yu(a,e.methods),e.model&&no(o,e.model),e.irregulars&&yd(o,e.irregulars),e.compute&&Object.assign(i,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(n),e.lib&&Object.keys(e.lib).forEach(u=>r[u]=e.lib[u]),e.tags&&r.addTags(e.tags),e.words&&r.addWords(e.words),e.frozen&&r.addWords(e.frozen,!0),e.mutate&&e.mutate(t,r)},"extend");var $d=Object.defineProperty,wd=l((e,t)=>$d(e,"name",{value:t,configurable:!0}),"n$13");const Pd=wd(function(e){const t=process.env?process.env:self.env||{};return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},"verbose");var kd=Object.defineProperty,bn=l((e,t)=>kd(e,"name",{value:t,configurable:!0}),"n$12");const jd=bn(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Pa=bn(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),Ad=bn(function(e){return e.map(t=>t.terms.map(n=>(Pa(n.tags)&&(n.tags=new Set(n.tags)),n)))},"fromJson"),xd=bn(function(e){return e.map(t=>t.map(n=>({text:n,normal:n,pre:"",post:" ",tags:new Set})))},"preTokenized"),wu=bn(function(e,t,n){const{methods:r}=n,a=new t([]);if(a.world=n,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){const o=r.one.tokenize.fromString(e,n);return new t(o)}if(jd(e)&&e.isView)return new t(e.document,e.ptrs);if(Pa(e)){if(Pa(e[0])){const i=xd(e);return new t(i)}const o=Ad(e);return new t(o)}return a},"inputs");var Cd=Object.defineProperty,Nd=l((e,t)=>Cd(e,"name",{value:t,configurable:!0}),"d$T");const dr=Object.assign({},$a),$=Nd(function(e,t){t&&$.addWords(t);const n=wu(e,yr,dr);return e&&n.compute(dr.hooks),n},"nlp");Object.defineProperty($,"_world",{value:dr,writable:!0});$.tokenize=function(e,t){const{compute:n}=this._world;t&&$.addWords(t);const r=wu(e,yr,dr);return n.contractions&&r.compute(["alias","normal","machine","contractions"]),r};$.plugin=function(e){return $u(e,this._world,yr,this),this};$.extend=$.plugin;$.world=function(){return this._world};$.model=function(){return this._world.model};$.methods=function(){return this._world.methods};$.hooks=function(){return this._world.hooks};$.verbose=Pd;$.version=md;var Od=Object.defineProperty,Td=l((e,t)=>Od(e,"name",{value:t,configurable:!0}),"f$1N");const Id=Td(function(e){return e.map(t=>{const n=new Set;return t.forEach(r=>{r.normal!==""&&n.add(r.normal),r.switch&&n.add(`%${r.switch}%`),r.implicit&&n.add(r.implicit),r.machine&&n.add(r.machine),r.root&&n.add(r.root),r.alias&&r.alias.forEach(o=>n.add(o));const a=Array.from(r.tags);for(let o=0;o<a.length;o+=1)n.add("#"+a[o])}),n})},"createCache"),Dd={one:{cacheDoc:Id}};var Ed=Object.defineProperty,ka=l((e,t)=>Ed(e,"name",{value:t,configurable:!0}),"t$P");const Hd={cache:ka(function(){return this._cache=this.methods.one.cacheDoc(this.document),this},"cache"),uncache:ka(function(){return this._cache=null,this},"uncache")},Gd=ka(function(e){Object.assign(e.prototype,Hd)},"addAPI");var Fd=Object.defineProperty,Vd=l((e,t)=>Fd(e,"name",{value:t,configurable:!0}),"e$1g");const zd={cache:Vd(function(e){e._cache=e.methods.one.cacheDoc(e.document)},"cache")},Sd={api:Gd,compute:zd,methods:Dd};var Bd=Object.defineProperty,Fn=l((e,t)=>Bd(e,"name",{value:t,configurable:!0}),"r$1n");const Md={toLowerCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toLowerCase()}),this},"toLowerCase"),toUpperCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toUpperCase()}),this},"toUpperCase"),toTitleCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.replace(/^ *[a-z\u00C0-\u00FF]/,t=>t.toUpperCase())}),this},"toTitleCase"),toCamelCase:Fn(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,r=>r.toUpperCase())),n!==e.length-1&&(t.post="")})}),this},"toCamelCase")};var Ld=Object.defineProperty,Xe=l((e,t)=>Ld(e,"name",{value:t,configurable:!0}),"a$1P");const Uo=Xe(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),Kd=Xe(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),Jd=Xe(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),Pu=Xe((e,t,n)=>{if(n.forEach(r=>r.dirty=!0),e){const r=[t,0].concat(n);Array.prototype.splice.apply(e,r)}return e},"spliceArr"),sn=Xe(function(e){const t=/ $/,n=/[-–—]/,r=e[e.length-1];r&&!t.test(r.post)&&!n.test(r.post)&&(r.post+=" ")},"endSpace"),Qo=Xe((e,t,n)=>{const r=/[-.?!,;:)–—'"]/g,a=e[t-1];if(!a)return;const o=a.post;if(r.test(o)){const i=o.match(r).join(""),s=n[n.length-1];s.post=i+s.post,a.post=a.post.replace(r,"")}},"movePunct"),Wd=Xe(function(e,t,n){const r=e[t];if(t!==0||!Uo(r.text))return;n[0].text=Kd(n[0].text);const a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||Uo(a.text)&&a.text.length>1&&(a.text=Jd(a.text))},"moveTitleCase"),qd=Xe(function(e,t,n,r){const[a,o,i]=t;o===0||i===r[a].length?sn(n):(sn(n),sn([e[t[1]]])),Wd(e,o,n),Pu(e,o,n)},"cleanPrepend"),Rd=Xe(function(e,t,n,r){const[a,,o]=t,i=(r[a]||[]).length;o<i?(Qo(e,o,n),sn(n)):i===o&&(sn(e),Qo(e,o,n),r[a+1]&&(n[n.length-1].post+=" ")),Pu(e,t[2],n),t[4]=n[n.length-1].id},"cleanAppend");var Ud=Object.defineProperty,ku=l((e,t)=>Ud(e,"name",{value:t,configurable:!0}),"a$1O");let en=0;const _o=ku(e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),"pad3"),ju=ku(function(e){let[t,n]=e.index||[0,0];en+=1,en=en>46655?0:en,t=t>46655?0:t,n=n>1294?0:n;let r=_o(en.toString(36));r+=_o(t.toString(36));let a=n.toString(36);a=a.length<2?"0"+a:a,r+=a;const o=parseInt(Math.random()*36,10);return r+=o.toString(36),e.normal+"|"+r.toUpperCase()},"toId");var Qd=Object.defineProperty,Pt=l((e,t)=>Qd(e,"name",{value:t,configurable:!0}),"r$1k");const Zo=Pt(function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},"expand"),Xo=Pt(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),_d=Pt(function(e){return e=e.map(t=>(t.id=ju(t),t)),e},"addIds"),Zd=Pt(function(e,t){const{methods:n}=t;return typeof e=="string"?n.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:Xo(e)?Xo(e[0])?e[0]:e:[]},"getTerms"),Yo=Pt(function(e,t,n){const{document:r,world:a}=t;t.uncache();const o=t.fullPointer,i=t.fullPointer;t.forEach((u,c)=>{const d=u.fullPointer[0],[h]=d,p=r[h];let b=Zd(e,a);b.length!==0&&(b=_d(b),n?(Zo(t.update([d]).firstTerm()),qd(p,d,b,r)):(Zo(t.update([d]).lastTerm()),Rd(p,d,b,r)),r[h]&&r[h][d[1]]&&(d[3]=r[h][d[1]].id),i[c]=d,d[2]+=b.length,o[c]=d)});const s=t.toView(o);return t.ptrs=i,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},"insert"),kt={insertAfter:Pt(function(e){return Yo(e,this,!1)},"insertAfter"),insertBefore:Pt(function(e){return Yo(e,this,!0)},"insertBefore")};kt.append=kt.insertAfter;kt.prepend=kt.insertBefore;kt.insert=kt.insertAfter;var Xd=Object.defineProperty,yn=l((e,t)=>Xd(e,"name",{value:t,configurable:!0}),"f$1M");const Yd=/\$[0-9a-z]+/g,ro={},eh=yn(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),th=yn(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),nh=yn(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),rh=yn(function(e,t,n){return e.forEach(r=>{const a=t(r);r.replaceWith(a,n)}),e},"replaceByFn"),ah=yn(function(e,t){if(typeof e!="string")return e;const n=t.groups();return e=e.replace(Yd,r=>{const a=r.replace(/\$/,"");return n.hasOwnProperty(a)?n[a].text():r}),e},"subDollarSign");ro.replaceWith=function(e,t={}){let n=this.fullPointer;const r=this;if(this.uncache(),typeof e=="function")return rh(r,e,t);const a=r.docs[0];if(!a)return r;const o=t.possessives&&a[a.length-1].tags.has("Possessive"),i=t.case&&eh(a[0].text);e=ah(e,r);const s=this.update(n);n=n.map(p=>p.slice(0,3));const u=(s.docs[0]||[]).map(p=>Array.from(p.tags)),c=s.docs[0][0].pre,d=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),r.insertAfter(e),s.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction+").contractions().expand(),r.delete(s),o){const p=r.docs[0],b=p[p.length-1];b.tags.has("Possessive")||(b.text+="'s",b.normal+="'s",b.tags.add("Possessive"))}if(c&&r.docs[0]&&(r.docs[0][0].pre=c),d&&r.docs[0]){const p=r.docs[0][r.docs[0].length-1];p.post.trim()||(p.post=d)}const h=r.toView(n).compute(["index","freeze","lexicon"]);if(h.world.compute.preTagger&&h.compute("preTagger"),h.compute("unfreeze"),t.tags&&h.terms().forEach((p,b)=>{p.tagSafe(u[b])}),!h.docs[0]||!h.docs[0][0])return h;if(t.case){const p=i?th:nh;h.docs[0][0].text=p(h.docs[0][0].text)}return h};ro.replace=function(e,t,n){if(e&&!t)return this.replaceWith(e,n);const r=this.match(e);return r.found?(this.soften(),r.replaceWith(t,n)):this};var oh=Object.defineProperty,Au=l((e,t)=>oh(e,"name",{value:t,configurable:!0}),"r$1j");const ih=Au(function(e,t){const n=e.length-1,r=e[n],a=e[n-t];a&&r&&(a.post+=r.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},"repairPunct"),sh=Au(function(e,t){t.forEach(n=>{const[r,a,o]=n,i=o-a;e[r]&&(o===e[r].length&&o>1&&ih(e[r],i),e[r].splice(a,i))});for(let n=e.length-1;n>=0;n-=1)if(e[n].length===0&&(e.splice(n,1),n===e.length&&e[n-1])){const r=e[n-1],a=r[r.length-1];a&&(a.post=a.post.trimEnd())}return e},"pluckOut");var uh=Object.defineProperty,xu=l((e,t)=>uh(e,"name",{value:t,configurable:!0}),"s$1l");const lh=xu(function(e,t){return e=e.map(n=>{const[r]=n;return t[r]&&t[r].forEach(a=>{const o=a[2]-a[1];n[1]<=a[1]&&n[2]>=a[2]&&(n[2]-=o)}),n}),e.forEach((n,r)=>{if(n[1]===0&&n[2]==0)for(let a=r+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(n=>n[2]-n[1]>0),e=e.map(n=>(n[3]=null,n[4]=null,n)),e},"fixPointers"),ja={remove:xu(function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let n=this.all(),r=this;e&&(n=this,r=this.match(e));const a=!n.ptrs;r.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction").contractions().expand();let o=n.fullPointer;const i=r.fullPointer.reverse(),s=sh(this.document,i),u=t(i);return o=lh(o,u),n.ptrs=o,n.document=s,n.compute("index"),a&&(n.ptrs=void 0),e?n.toView(o):(this.ptrs=[],n.none())},"remove")};ja.delete=ja.remove;var ch=Object.defineProperty,pt=l((e,t)=>ch(e,"name",{value:t,configurable:!0}),"e$1c");const dn={pre:pt(function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(n=>{const r=n[0];t===!0?r.pre+=e:r.pre=e}),this)},"pre"),post:pt(function(e,t){if(e===void 0){const n=this.docs[this.docs.length-1];return n[n.length-1].post}return this.docs.forEach(n=>{const r=n[n.length-1];t===!0?r.post+=e:r.post=e}),this},"post"),trim:pt(function(){if(!this.found)return this;const e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();const n=e[e.length-1],r=n[n.length-1];return r.post=r.post.trimEnd(),this},"trim"),hyphenate:pt(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.pre=""),e[n+1]&&(t.post="-")})}),this},"hyphenate"),dehyphenate:pt(function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(n=>{e.test(n.post)&&(n.post=" ")})}),this},"dehyphenate"),toQuotations:pt(function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toQuotations"),toParentheses:pt(function(e,t){return e=e||"(",t=t||")",this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toParentheses")};dn.deHyphenate=dn.dehyphenate;dn.toQuotation=dn.toQuotations;var dh=Object.defineProperty,$n=l((e,t)=>dh(e,"name",{value:t,configurable:!0}),"o$1M");const hh=$n((e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,"alpha"),ph=$n((e,t)=>{const n=e.normal.trim().length,r=t.normal.trim().length;return n<r?1:n>r?-1:0},"length"),fh=$n((e,t)=>e.words<t.words?1:e.words>t.words?-1:0,"wordCount"),gh=$n((e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,"sequential"),mh=$n(function(e){const t={};return e.forEach(n=>{t[n.normal]=t[n.normal]||0,t[n.normal]+=1}),e.sort((n,r)=>{const a=t[n.normal],o=t[r.normal];return a<o?1:a>o?-1:0}),e},"byFreq"),Zr={alpha:hh,length:ph,wordCount:fh,sequential:gh,byFreq:mh};var vh=Object.defineProperty,$r=l((e,t)=>vh(e,"name",{value:t,configurable:!0}),"a$1L");const bh=new Set(["index","sequence","seq","sequential","chron","chronological"]),yh=new Set(["freq","frequency","topk","repeats"]),$h=new Set(["alpha","alphabetical"]),wh=$r(function(e,t){let n=e.fullPointer;return n=n.sort((r,a)=>(r=e.update([r]),a=e.update([a]),t(r,a))),e.ptrs=n,e},"customSort"),Ph=$r(function(e){const{docs:t,pointer:n}=this;if(this.uncache(),typeof e=="function")return wh(this,e);e=e||"alpha";const r=n||t.map((o,i)=>[i]);let a=t.map((o,i)=>({index:i,words:o.length,normal:o.map(s=>s.machine||s.normal||"").join(" "),pointer:r[i]}));return bh.has(e)&&(e="sequential"),$h.has(e)&&(e="alpha"),yh.has(e)?(a=Zr.byFreq(a),this.update(a.map(o=>o.pointer))):typeof Zr[e]=="function"?(a=a.sort(Zr[e]),this.update(a.map(o=>o.pointer))):this},"sort"),kh=$r(function(){let e=this.pointer||this.docs.map((t,n)=>[n]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},"reverse"),jh=$r(function(){const e=new Set;return this.filter(t=>{const n=t.text("machine");return e.has(n)?!1:(e.add(n),!0)})},"unique"),Ah={unique:jh,reverse:kh,sort:Ph};var xh=Object.defineProperty,wr=l((e,t)=>xh(e,"name",{value:t,configurable:!0}),"o$1L");const Ch=wr(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Cu=wr(function(e,t){if(e.length>0){const n=e[e.length-1],r=n[n.length-1];/ /.test(r.post)===!1&&(r.post+=" ")}return e=e.concat(t),e},"combineDocs"),Nh=wr(function(e,t){if(e.document===t.document){const n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Cu(e.document,t.docs),e.all()},"combineViews"),Oh={concat:wr(function(e){if(typeof e=="string"){const t=this.fromText(e);if(!this.found||!this.ptrs)this.document=this.document.concat(t.document);else{const n=this.fullPointer,r=n[n.length-1][0];this.document.splice(r,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return Nh(this,e);if(Ch(e)){const t=Cu(this.document,e);return this.document=t,this.all()}return this},"concat")};var Th=Object.defineProperty,Nu=l((e,t)=>Th(e,"name",{value:t,configurable:!0}),"n$$");const Ih=Nu(function(){return this.ptrs=this.fullPointer,this},"harden"),Dh=Nu(function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},"soften"),Eh={harden:Ih,soften:Dh};var Hh=Object.defineProperty,Gh=l((e,t)=>Hh(e,"name",{value:t,configurable:!0}),"r$1g");const Fh=Object.assign({},Md,kt,ro,ja,dn,Ah,Oh,Eh),Vh=Gh(function(e){Object.assign(e.prototype,Fh)},"addAPI");var zh=Object.defineProperty,Sh=l((e,t)=>zh(e,"name",{value:t,configurable:!0}),"d$P");const Bh={id:Sh(function(e){const t=e.docs;for(let n=0;n<t.length;n+=1)for(let r=0;r<t[n].length;r+=1){const a=t[n][r];a.id=a.id||ju(a)}},"id")},Mh={api:Vh,compute:Bh},Lh=[{word:"@",out:["at"]},{word:"arent",out:["are","not"]},{word:"alot",out:["a","lot"]},{word:"brb",out:["be","right","back"]},{word:"cannot",out:["can","not"]},{word:"dun",out:["do","not"]},{word:"can't",out:["can","not"]},{word:"shan't",out:["should","not"]},{word:"won't",out:["will","not"]},{word:"that's",out:["that","is"]},{word:"what's",out:["what","is"]},{word:"let's",out:["let","us"]},{word:"dunno",out:["do","not","know"]},{word:"gonna",out:["going","to"]},{word:"gotta",out:["have","got","to"]},{word:"gimme",out:["give","me"]},{word:"outta",out:["out","of"]},{word:"tryna",out:["trying","to"]},{word:"gtg",out:["got","to","go"]},{word:"im",out:["i","am"]},{word:"imma",out:["I","will"]},{word:"imo",out:["in","my","opinion"]},{word:"irl",out:["in","real","life"]},{word:"ive",out:["i","have"]},{word:"rn",out:["right","now"]},{word:"tbh",out:["to","be","honest"]},{word:"wanna",out:["want","to"]},{word:"c'mere",out:["come","here"]},{word:"c'mon",out:["come","on"]},{word:"shoulda",out:["should","have"]},{word:"coulda",out:["coulda","have"]},{word:"woulda",out:["woulda","have"]},{word:"musta",out:["must","have"]},{word:"tis",out:["it","is"]},{word:"twas",out:["it","was"]},{word:"y'know",out:["you","know"]},{word:"ne'er",out:["never"]},{word:"o'er",out:["over"]},{after:"ll",out:["will"]},{after:"ve",out:["have"]},{after:"re",out:["are"]},{after:"m",out:["am"]},{before:"c",out:["ce"]},{before:"m",out:["me"]},{before:"n",out:["ne"]},{before:"qu",out:["que"]},{before:"s",out:["se"]},{before:"t",out:["tu"]},{word:"shouldnt",out:["should","not"]},{word:"couldnt",out:["could","not"]},{word:"wouldnt",out:["would","not"]},{word:"hasnt",out:["has","not"]},{word:"wasnt",out:["was","not"]},{word:"isnt",out:["is","not"]},{word:"cant",out:["can","not"]},{word:"dont",out:["do","not"]},{word:"wont",out:["will","not"]},{word:"howd",out:["how","did"]},{word:"whatd",out:["what","did"]},{word:"whend",out:["when","did"]},{word:"whered",out:["where","did"]}],Kh={st:!0,nd:!0,rd:!0,th:!0,am:!0,pm:!0,max:!0,"°":!0,s:!0,e:!0,er:!0,ère:!0,ème:!0},Jh={one:{contractions:Lh,numberSuffixes:Kh}};var Wh=Object.defineProperty,qh=l((e,t)=>Wh(e,"name",{value:t,configurable:!0}),"a$1J");const Xr=qh(function(e,t,n){const[r,a]=t;!n||n.length===0||(n=n.map((o,i)=>(o.implicit=o.text,o.machine=o.text,o.pre="",o.post="",o.text="",o.normal="",o.index=[r,a+i],o)),n[0]&&(n[0].pre=e[r][a].pre,n[n.length-1].post=e[r][a].post,n[0].text=e[r][a].text,n[0].normal=e[r][a].normal),e[r].splice(a,1,...n))},"insertContraction");var Rh=Object.defineProperty,Uh=l((e,t)=>Rh(e,"name",{value:t,configurable:!0}),"t$M");const Qh=/'/,_h=new Set(["what","how","when","where","why"]),Zh=new Set(["be","go","start","think","need"]),Xh=new Set(["been","gone"]),Yh=Uh(function(e,t){const n=e[t].normal.split(Qh)[0];if(_h.has(n))return[n,"did"];if(e[t+1]){if(Xh.has(e[t+1].normal))return[n,"had"];if(Zh.has(e[t+1].normal))return[n,"would"]}return null},"_apostropheD");var ep=Object.defineProperty,tp=l((e,t)=>ep(e,"name",{value:t,configurable:!0}),"r$1d");const np=tp(function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},"apostropheT");var rp=Object.defineProperty,ao=l((e,t)=>rp(e,"name",{value:t,configurable:!0}),"s$1h");const oo=/'/,ap=/(e|é|aison|sion|tion)$/,op=/(age|isme|acle|ege|oire)$/,ip=ao((e,t)=>{const n=e[t].normal.split(oo)[1];return n&&n.endsWith("e")?["la",n]:["le",n]},"preL"),sp=ao((e,t)=>{const n=e[t].normal.split(oo)[1];return n&&ap.test(n)&&!op.test(n)?["du",n]:n&&n.endsWith("s")?["des",n]:["de",n]},"preD"),up=ao((e,t)=>["je",e[t].normal.split(oo)[1]],"preJ"),Yr={preJ:up,preL:ip,preD:sp};var lp=Object.defineProperty,cp=l((e,t)=>lp(e,"name",{value:t,configurable:!0}),"u$1F");const dp=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,hp=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,pp=/^[0-9]{3}-[0-9]{4}$/,fp=cp(function(e,t){const n=e[t];let r=n.text.match(dp);return r!==null?n.tags.has("PhoneNumber")===!0||pp.test(n.text)?null:[r[1],"to",r[2]]:(r=n.text.match(hp),r!==null?[r[1],"to",r[4]]:null)},"numberRange");var gp=Object.defineProperty,mp=l((e,t)=>gp(e,"name",{value:t,configurable:!0}),"o$1G");const vp=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,bp=mp(function(e,t,n){const r=n.model.one.numberSuffixes||{},a=e[t].text.match(vp);if(a!==null){const o=a[2].toLowerCase().trim();return r.hasOwnProperty(o)?null:[a[1],o]}return null},"numberUnit");var yp=Object.defineProperty,Ge=l((e,t)=>yp(e,"name",{value:t,configurable:!0}),"i$1K");const ei=/'/,$p=/^[0-9][^-–—]*[-–—].*?[0-9]/,ti=Ge(function(e,t,n,r){const a=t.update();a.document=[e];let o=n+r;n>0&&(n-=1),e[o]&&(o+=1),a.ptrs=[[0,n,o]]},"reTag"),ni={t:Ge((e,t)=>np(e,t),"t"),d:Ge((e,t)=>Yh(e,t),"d")},ri={j:Ge((e,t)=>Yr.preJ(e,t),"j"),l:Ge((e,t)=>Yr.preL(e,t),"l"),d:Ge((e,t)=>Yr.preD(e,t),"d")},wp=Ge(function(e,t,n,r){for(let a=0;a<e.length;a+=1){const o=e[a];if(o.word===t.normal)return o.out;if(r!==null&&r===o.after)return[n].concat(o.out);if(n!==null&&n===o.before&&r&&r.length>2)return o.out.concat(r)}return null},"knownOnes"),ea=Ge(function(e,t){const n=t.fromText(e.join(" "));return n.compute(["id","alias"]),n.docs[0]},"toDocs"),Pp=Ge(function(e,t){for(let n=t+1;n<5&&e[n];n+=1)if(e[n].normal==="been")return["there","has"];return["there","is"]},"thereHas"),kp=Ge(e=>{const{world:t,document:n}=e,{model:r,methods:a}=t,o=r.one.contractions||[];n.forEach((i,s)=>{for(let u=i.length-1;u>=0;u-=1){let c=null,d=null;if(ei.test(i[u].normal)===!0){const p=i[u].normal.split(ei);c=p[0],d=p[1]}let h=wp(o,i[u],c,d);if(!h&&ni.hasOwnProperty(d)&&(h=ni[d](i,u,t)),!h&&ri.hasOwnProperty(c)&&(h=ri[c](i,u)),c==="there"&&d==="s"&&(h=Pp(i,u)),h){h=ea(h,e),Xr(n,[s,u],h),ti(n[s],e,u,h.length);continue}if($p.test(i[u].normal)){h=fp(i,u),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag(h,"NumberRange",t),h[2]&&h[2].tags.has("Time")&&a.one.setTag([h[0]],"Time",t,null,"time-range"),ti(n[s],e,u,h.length));continue}h=bp(i,u,t),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag([h[1]],"Unit",t,null,"contraction-unit"))}})},"contractions"),jp={contractions:kp},Ap={model:Jh,compute:jp,hooks:["contractions"]};var xp=Object.defineProperty,Ou=l((e,t)=>xp(e,"name",{value:t,configurable:!0}),"i$1J");const ai=Ou(function(e){const t=e.world,{model:n,methods:r}=e.world,a=r.one.setTag,{frozenLex:o}=n.one,i=n.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){const c=s[u],d=c.machine||c.normal;if(i[d]!==void 0&&s[u+1]){const h=u+i[d]-1;for(let p=h;p>u;p-=1){const b=s.slice(u,p+1),x=b.map(G=>G.machine||G.normal).join(" ");if(o.hasOwnProperty(x)===!0){a(b,o[x],t,!1,"1-frozen-multi-lexicon"),b.forEach(G=>G.frozen=!0);continue}}}if(o[d]!==void 0&&o.hasOwnProperty(d)){a([c],o[d],t,!1,"1-freeze-lexicon"),c.frozen=!0;continue}}})},"freeze"),Cp=Ou(function(e){return e.docs.forEach(t=>{t.forEach(n=>{delete n.frozen})}),e},"unfreeze"),Np={frozen:ai,freeze:ai,unfreeze:Cp};var Op=Object.defineProperty,io=l((e,t)=>Op(e,"name",{value:t,configurable:!0}),"t$J");const oi=io(e=>"\x1B[34m"+e+"\x1B[0m","blue"),ii=io(e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m","dim"),si=io(function(e){e.docs.forEach(t=>{console.log(oi(`
1
+ var Tc=Object.defineProperty;var l=(e,t)=>Tc(e,"name",{value:t,configurable:!0});import{createRequire as Ic}from"node:module";import{E as _e,q as Ec,e as vr,T as Hc,I as pu}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{a as Jt,z as Xa,l as Ya,B as Gc,C as Lt,M as cn}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{fingerprint as zt,listRules as fu,listRequiredValidators as Fc,scan as gu,scanFiles as Vc,inspectRuleset as zc}from"@visulima/secret-scanner";import{c4 as Sc,c5 as qo,p as Pe}from"./bin.js";import{$ as _r}from"../packem_shared/spinners-f91Rbo99-Bjf3NcO0.js";import{s as Mc,E as Lc}from"./config.js";const Dc=Ic(import.meta.url),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Za=l(e=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[t,n]=Xt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Xt.getBuiltinModule(e)}return Dc(e)},"__cjs_getBuiltinModule"),{createRequire:Bc}=Za("node:module"),{pathToFileURL:mu}=Za("node:url"),{execFileSync:Kc}=Za("node:child_process");var Jc=Object.defineProperty,eo=l((e,t)=>Jc(e,"name",{value:t,configurable:!0}),"n$17"),Wc=Object.defineProperty,br=eo((e,t)=>Wc(e,"name",{value:t,configurable:!0}),"h");const qc=Bc(import.meta.url),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rc=br(e=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[t,n]=Yt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Yt.getBuiltinModule(e)}return qc(e)},"__cjs_getBuiltinModule"),{styleText:Uc}=Rc("node:util");var Qc=Object.defineProperty,to=br((e,t)=>Qc(e,"name",{value:t,configurable:!0}),"r");const _c={error:"✖",info:"ℹ",success:"✓",warning:"⚠"},Zc=to(e=>{const t=[];return e.bold&&t.push("bold"),e.dim&&t.push("dim"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),e.strikethrough&&t.push("strikethrough"),e.color&&t.push(e.color),e.bgColor&&t.push(e.bgColor),t.length===0?n=>n:n=>Uc(t,n)},"resolveStyleToFunction");let vu=class{static{l(this,"a")}static{eo(this,"m")}static{br(this,"Spinner")}static{to(this,"Spinner")}#t=0;#o;#e=!1;#r="";#i="";#f=0;#d=0;#a;#n;#h="";#l;#p;#s;#g;constructor(t={},n){this.#l=t.name??"dots",this.#p=t.verbose!==!1,this.#r=t.prefixText??"",this.#a=n,this.#g={..._c,...t.icons},typeof t.style=="function"?this.#s=t.style:t.style&&(this.#s=Zc(t.style))}get elapsedTime(){return(this.#d||Date.now())-this.#f}get text(){return this.#i}get getText(){return this.#i}set text(t){this.#i=t,this.#e&&(this.#n?this.#n.renderAll():this.#a&&this.#u())}get prefixText(){return this.#r}get getPrefixText(){return this.#r}set prefixText(t){this.#r=t,this.#e&&(this.#n?this.#n.renderAll():this.#a&&this.#u())}get isRunning(){return this.#e}setInteractiveManager(t){this.#a=t}setMultiSpinner(t){this.#n=t}start(t,n){if(this.#e)return this;if(!this.#p)return this;this.#e=!0,this.#f=Date.now(),this.#d=0,this.#t=0,t&&(this.#i=t),n?.prefixText&&(this.#r=n.prefixText);const r=this.#n??this.#a;r&&(this.#n?r.renderAll():(r.hook(),this.#u()));const a=_r(this.#l);return this.#o=setInterval(()=>{this.#e&&(this.#t=(this.#t+1)%a.frames.length,this.#n?this.#n.renderAll():this.#a&&this.#u())},a.interval),this}succeed(t){this.#c("success",t)}failed(t){this.#c("error",t)}warn(t){this.#c("warning",t)}info(t){this.#c("info",t)}pause(){this.#o&&(clearInterval(this.#o),this.#o=void 0)}resume(){if(!this.#e)return;this.#o&&clearInterval(this.#o);const t=_r(this.#l);this.#o=setInterval(()=>{this.#e&&(this.#t=(this.#t+1)%t.frames.length,this.#n?this.#n.renderAll():this.#a&&this.#u())},t.interval)}getFrameOutput(){if(!this.#e&&this.#h)return this.#h;const t=_r(this.#l).frames[this.#t];let n=this.#s?this.#s(t):t;return this.#r&&(n=`${this.#r} ${n}`),this.#i&&(n=`${n} ${this.#i}`),n}#u(){this.#a&&this.#a.update("stdout",[this.getFrameOutput()])}#c(t,n){if(!this.#e||(this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#e=!1,this.#d=Date.now(),!this.#p))return;let r="";const a=this.#g[t];a&&(r=this.#s?this.#s(a):a),this.#r&&(r=`${this.#r} ${r}`),n&&(r=`${r} ${n}`),this.#h=r,(this.#n??this.#a)&&(this.#n?this.#n.renderAll():this.#a&&(this.#a.update("stdout",[r]),this.#a.unhook(!1)))}},DN=class{static{l(this,"T")}static{eo(this,"b")}static{br(this,"MultiSpinner")}static{to(this,"MultiSpinner")}#t=new Map;#o=0;#e;#r=!1;#i;constructor(t={},n){this.#i=t,this.#e=n}setInteractiveManager(t){this.#e=t}create(t,n={}){const r=`spinner_${String(this.#o++)}`,a=new vu({...this.#i,...n});return a.setMultiSpinner(this),this.#t.set(r,a),t&&(a.text=t),a}remove(t){for(const[n,r]of this.#t.entries())if(r===t)return this.#t.delete(n),this.renderAll(),!0;return!1}stop(){for(const t of this.#t.values())t.succeed();this.#t.clear(),this.#r=!1,this.#e&&this.#e.unhook(!1)}clear(){for(const t of this.#t.values())t.succeed();this.#t.clear()}renderAll(){if(!this.#e)return;this.#r||(this.#r=!0,this.#e.hook());const t=[];for(const n of this.#t.values())t.push(n.getFrameOutput());t.length>0&&this.#e.update("stdout",t)}};const Xc={one:{},two:{},three:{},four:{}},Yc={one:{},two:{},three:{}},ed={},td=[],$a={methods:Xc,model:Yc,compute:ed,hooks:td};var nd=Object.defineProperty,bu=l((e,t)=>nd(e,"name",{value:t,configurable:!0}),"s$1o");const rd=bu(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),ad={compute:bu(function(e){const{world:t}=this,n=t.compute;return typeof e=="string"&&n.hasOwnProperty(e)?n[e](this):rd(e)?e.forEach(r=>{t.compute.hasOwnProperty(r)?n[r](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this},"compute")};var od=Object.defineProperty,qt=l((e,t)=>od(e,"name",{value:t,configurable:!0}),"o$1V");const id=qt(function(e){return this.fullPointer.forEach((t,n)=>{const r=this.update([t]);e(r,n)}),this},"forEach"),sd=qt(function(e,t){const n=this.fullPointer.map((a,o)=>{const i=this.update([a]),s=e(i,o);return s===void 0?this.none():s});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let r=[];return n.forEach(a=>{r=r.concat(a.fullPointer)}),this.toView(r)},"map"),ud=qt(function(e){let t=this.fullPointer;return t=t.filter((n,r)=>{const a=this.update([n]);return e(a,r)}),this.update(t)},"filter"),ld=qt(function(e){const t=this.fullPointer.find((n,r)=>{const a=this.update([n]);return e(a,r)});return this.update([t])},"find"),cd=qt(function(e){return this.fullPointer.some((t,n)=>{const r=this.update([t]);return e(r,n)})},"some"),dd=qt(function(e=1){let t=this.fullPointer,n=Math.floor(Math.random()*t.length);return n+e>this.length&&(n=this.length-e,n=n<0?0:n),t=t.slice(n,n+e),this.update(t)},"random"),hd={forEach:id,map:sd,filter:ud,find:ld,some:cd,random:dd};var pd=Object.defineProperty,Y=l((e,t)=>pd(e,"name",{value:t,configurable:!0}),"r$1p");const Ie={termList:Y(function(){return this.methods.one.termList(this.docs)},"termList"),terms:Y(function(e){const t=this.match(".");return typeof e=="number"?t.eq(e):t},"terms"),groups:Y(function(e){if(e||e===0)return this.update(this._groups[e]||[]);const t={};return Object.keys(this._groups).forEach(n=>{t[n]=this.update(this._groups[n])}),t},"groups"),eq:Y(function(e){let t=this.pointer;return t||(t=this.docs.map((n,r)=>[r])),t[e]?this.update([t[e]]):this.none()},"eq"),first:Y(function(){return this.eq(0)},"first"),last:Y(function(){const e=this.fullPointer.length-1;return this.eq(e)},"last"),firstTerms:Y(function(){return this.match("^.")},"firstTerms"),lastTerms:Y(function(){return this.match(".$")},"lastTerms"),slice:Y(function(e,t){let n=this.pointer||this.docs.map((r,a)=>[a]);return n=n.slice(e,t),this.update(n)},"slice"),all:Y(function(){return this.update().toView()},"all"),fullSentences:Y(function(){const e=this.fullPointer.map(t=>[t[0]]);return this.update(e).toView()},"fullSentences"),none:Y(function(){return this.update([])},"none"),isDoc:Y(function(e){if(!e||!e.isView)return!1;const t=this.fullPointer,n=e.fullPointer;return!t.length===n.length?!1:t.every((r,a)=>n[a]?r[0]===n[a][0]&&r[1]===n[a][1]&&r[2]===n[a][2]:!1)},"isDoc"),wordCount:Y(function(){return this.docs.reduce((e,t)=>(e+=t.filter(n=>n.text!=="").length,e),0)},"wordCount"),isFull:Y(function(){const e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,n=0;return this.document.forEach(r=>t+=r.length),this.docs.forEach(r=>n+=r.length),t===n},"isFull"),getNth:Y(function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this},"getNth")};Ie.group=Ie.groups;Ie.fullSentence=Ie.fullSentences;Ie.sentence=Ie.fullSentences;Ie.lastTerm=Ie.lastTerms;Ie.firstTerm=Ie.firstTerms;const wa=Object.assign({},Ie,ad,hd);wa.get=wa.eq;var fd=Object.defineProperty,gd=l((e,t)=>fd(e,"name",{value:t,configurable:!0}),"l$1p");let yr=class ar{static{l(this,"h")}static{gd(this,"View")}constructor(t,n,r={}){[["document",t],["world",$a],["_groups",r],["_cache",null],["viewType","View"]].forEach(a=>{Object.defineProperty(this,a[0],{value:a[1],writable:!0})}),this.ptrs=n}get docs(){let t=this.document;return this.ptrs&&(t=$a.methods.one.getDoc(this.ptrs,this.document)),t}get pointer(){return this.ptrs}get methods(){return this.world.methods}get model(){return this.world.model}get hooks(){return this.world.hooks}get isView(){return!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){const{docs:t,ptrs:n,document:r}=this;return(n||t.map((a,o)=>[o])).map(a=>{let[o,i,s,u,c]=a;return i=i||0,s=s||(r[o]||[]).length,r[o]&&r[o][i]&&(u=u||r[o][i].id,r[o][s-1]&&(c=c||r[o][s-1].id)),[o,i,s,u,c]})}update(t){const n=new ar(this.document,t);if(this._cache&&t&&t.length>0){const r=[];t.forEach((a,o)=>{const[i,s,u]=a;a.length===1?r[o]=this._cache[i]:s===0&&this.document[i].length===u&&(r[o]=this._cache[i])}),r.length>0&&(n._cache=r)}return n.world=this.world,n}toView(t){return new ar(this.document,t||this.pointer)}fromText(t){const{methods:n}=this,r=n.one.tokenize.fromString(t,this.world),a=new ar(r);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(r=>r.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));const n=this.update(this.pointer);return n.document=t,n._cache=this._cache,n}};Object.assign(yr.prototype,wa);const md="14.15.0";var vd=Object.defineProperty,Rt=l((e,t)=>vd(e,"name",{value:t,configurable:!0}),"a$1R");const Ro=Rt(function(e){return e&&typeof e=="object"&&!Array.isArray(e)},"isObject"),bd=Rt(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray");function no(e,t){if(Ro(t))for(const n in t)Ro(t[n])?(e[n]||Object.assign(e,{[n]:{}}),no(e[n],t[n])):Object.assign(e,{[n]:t[n]});return e}l(no,"c$1M");Rt(no,"mergeDeep");function yu(e,t){for(const n in t)e[n]=e[n]||{},Object.assign(e[n],t[n]);return e}l(yu,"h$1s");Rt(yu,"mergeQuick");const yd=Rt(function(e,t){const n=e.two.models||{};Object.keys(t).forEach(r=>{t[r].pastTense&&(n.toPast&&(n.toPast.ex[r]=t[r].pastTense),n.fromPast&&(n.fromPast.ex[t[r].pastTense]=r)),t[r].presentTense&&(n.toPresent&&(n.toPresent.ex[r]=t[r].presentTense),n.fromPresent&&(n.fromPresent.ex[t[r].presentTense]=r)),t[r].gerund&&(n.toGerund&&(n.toGerund.ex[r]=t[r].gerund),n.fromGerund&&(n.fromGerund.ex[t[r].gerund]=r)),t[r].comparative&&(n.toComparative&&(n.toComparative.ex[r]=t[r].comparative),n.fromComparative&&(n.fromComparative.ex[t[r].comparative]=r)),t[r].superlative&&(n.toSuperlative&&(n.toSuperlative.ex[r]=t[r].superlative),n.fromSuperlative&&(n.fromSuperlative.ex[t[r].superlative]=r))})},"addIrregulars"),$u=Rt(function(e,t,n,r){if(bd(e)){e.forEach(u=>$u(u,t,n,r));return}const{methods:a,model:o,compute:i,hooks:s}=t;e.methods&&yu(a,e.methods),e.model&&no(o,e.model),e.irregulars&&yd(o,e.irregulars),e.compute&&Object.assign(i,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(n),e.lib&&Object.keys(e.lib).forEach(u=>r[u]=e.lib[u]),e.tags&&r.addTags(e.tags),e.words&&r.addWords(e.words),e.frozen&&r.addWords(e.frozen,!0),e.mutate&&e.mutate(t,r)},"extend");var $d=Object.defineProperty,wd=l((e,t)=>$d(e,"name",{value:t,configurable:!0}),"n$13");const Pd=wd(function(e){const t=process.env?process.env:self.env||{};return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},"verbose");var kd=Object.defineProperty,bn=l((e,t)=>kd(e,"name",{value:t,configurable:!0}),"n$12");const jd=bn(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Pa=bn(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),Ad=bn(function(e){return e.map(t=>t.terms.map(n=>(Pa(n.tags)&&(n.tags=new Set(n.tags)),n)))},"fromJson"),xd=bn(function(e){return e.map(t=>t.map(n=>({text:n,normal:n,pre:"",post:" ",tags:new Set})))},"preTokenized"),wu=bn(function(e,t,n){const{methods:r}=n,a=new t([]);if(a.world=n,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){const o=r.one.tokenize.fromString(e,n);return new t(o)}if(jd(e)&&e.isView)return new t(e.document,e.ptrs);if(Pa(e)){if(Pa(e[0])){const i=xd(e);return new t(i)}const o=Ad(e);return new t(o)}return a},"inputs");var Cd=Object.defineProperty,Nd=l((e,t)=>Cd(e,"name",{value:t,configurable:!0}),"d$T");const dr=Object.assign({},$a),$=Nd(function(e,t){t&&$.addWords(t);const n=wu(e,yr,dr);return e&&n.compute(dr.hooks),n},"nlp");Object.defineProperty($,"_world",{value:dr,writable:!0});$.tokenize=function(e,t){const{compute:n}=this._world;t&&$.addWords(t);const r=wu(e,yr,dr);return n.contractions&&r.compute(["alias","normal","machine","contractions"]),r};$.plugin=function(e){return $u(e,this._world,yr,this),this};$.extend=$.plugin;$.world=function(){return this._world};$.model=function(){return this._world.model};$.methods=function(){return this._world.methods};$.hooks=function(){return this._world.hooks};$.verbose=Pd;$.version=md;var Od=Object.defineProperty,Td=l((e,t)=>Od(e,"name",{value:t,configurable:!0}),"f$1N");const Id=Td(function(e){return e.map(t=>{const n=new Set;return t.forEach(r=>{r.normal!==""&&n.add(r.normal),r.switch&&n.add(`%${r.switch}%`),r.implicit&&n.add(r.implicit),r.machine&&n.add(r.machine),r.root&&n.add(r.root),r.alias&&r.alias.forEach(o=>n.add(o));const a=Array.from(r.tags);for(let o=0;o<a.length;o+=1)n.add("#"+a[o])}),n})},"createCache"),Dd={one:{cacheDoc:Id}};var Ed=Object.defineProperty,ka=l((e,t)=>Ed(e,"name",{value:t,configurable:!0}),"t$P");const Hd={cache:ka(function(){return this._cache=this.methods.one.cacheDoc(this.document),this},"cache"),uncache:ka(function(){return this._cache=null,this},"uncache")},Gd=ka(function(e){Object.assign(e.prototype,Hd)},"addAPI");var Fd=Object.defineProperty,Vd=l((e,t)=>Fd(e,"name",{value:t,configurable:!0}),"e$1g");const zd={cache:Vd(function(e){e._cache=e.methods.one.cacheDoc(e.document)},"cache")},Sd={api:Gd,compute:zd,methods:Dd};var Bd=Object.defineProperty,Fn=l((e,t)=>Bd(e,"name",{value:t,configurable:!0}),"r$1n");const Md={toLowerCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toLowerCase()}),this},"toLowerCase"),toUpperCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toUpperCase()}),this},"toUpperCase"),toTitleCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.replace(/^ *[a-z\u00C0-\u00FF]/,t=>t.toUpperCase())}),this},"toTitleCase"),toCamelCase:Fn(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,r=>r.toUpperCase())),n!==e.length-1&&(t.post="")})}),this},"toCamelCase")};var Ld=Object.defineProperty,Xe=l((e,t)=>Ld(e,"name",{value:t,configurable:!0}),"a$1P");const Uo=Xe(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),Kd=Xe(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),Jd=Xe(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),Pu=Xe((e,t,n)=>{if(n.forEach(r=>r.dirty=!0),e){const r=[t,0].concat(n);Array.prototype.splice.apply(e,r)}return e},"spliceArr"),sn=Xe(function(e){const t=/ $/,n=/[-–—]/,r=e[e.length-1];r&&!t.test(r.post)&&!n.test(r.post)&&(r.post+=" ")},"endSpace"),Qo=Xe((e,t,n)=>{const r=/[-.?!,;:)–—'"]/g,a=e[t-1];if(!a)return;const o=a.post;if(r.test(o)){const i=o.match(r).join(""),s=n[n.length-1];s.post=i+s.post,a.post=a.post.replace(r,"")}},"movePunct"),Wd=Xe(function(e,t,n){const r=e[t];if(t!==0||!Uo(r.text))return;n[0].text=Kd(n[0].text);const a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||Uo(a.text)&&a.text.length>1&&(a.text=Jd(a.text))},"moveTitleCase"),qd=Xe(function(e,t,n,r){const[a,o,i]=t;o===0||i===r[a].length?sn(n):(sn(n),sn([e[t[1]]])),Wd(e,o,n),Pu(e,o,n)},"cleanPrepend"),Rd=Xe(function(e,t,n,r){const[a,,o]=t,i=(r[a]||[]).length;o<i?(Qo(e,o,n),sn(n)):i===o&&(sn(e),Qo(e,o,n),r[a+1]&&(n[n.length-1].post+=" ")),Pu(e,t[2],n),t[4]=n[n.length-1].id},"cleanAppend");var Ud=Object.defineProperty,ku=l((e,t)=>Ud(e,"name",{value:t,configurable:!0}),"a$1O");let en=0;const _o=ku(e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),"pad3"),ju=ku(function(e){let[t,n]=e.index||[0,0];en+=1,en=en>46655?0:en,t=t>46655?0:t,n=n>1294?0:n;let r=_o(en.toString(36));r+=_o(t.toString(36));let a=n.toString(36);a=a.length<2?"0"+a:a,r+=a;const o=parseInt(Math.random()*36,10);return r+=o.toString(36),e.normal+"|"+r.toUpperCase()},"toId");var Qd=Object.defineProperty,Pt=l((e,t)=>Qd(e,"name",{value:t,configurable:!0}),"r$1k");const Zo=Pt(function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},"expand"),Xo=Pt(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),_d=Pt(function(e){return e=e.map(t=>(t.id=ju(t),t)),e},"addIds"),Zd=Pt(function(e,t){const{methods:n}=t;return typeof e=="string"?n.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:Xo(e)?Xo(e[0])?e[0]:e:[]},"getTerms"),Yo=Pt(function(e,t,n){const{document:r,world:a}=t;t.uncache();const o=t.fullPointer,i=t.fullPointer;t.forEach((u,c)=>{const d=u.fullPointer[0],[h]=d,p=r[h];let b=Zd(e,a);b.length!==0&&(b=_d(b),n?(Zo(t.update([d]).firstTerm()),qd(p,d,b,r)):(Zo(t.update([d]).lastTerm()),Rd(p,d,b,r)),r[h]&&r[h][d[1]]&&(d[3]=r[h][d[1]].id),i[c]=d,d[2]+=b.length,o[c]=d)});const s=t.toView(o);return t.ptrs=i,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},"insert"),kt={insertAfter:Pt(function(e){return Yo(e,this,!1)},"insertAfter"),insertBefore:Pt(function(e){return Yo(e,this,!0)},"insertBefore")};kt.append=kt.insertAfter;kt.prepend=kt.insertBefore;kt.insert=kt.insertAfter;var Xd=Object.defineProperty,yn=l((e,t)=>Xd(e,"name",{value:t,configurable:!0}),"f$1M");const Yd=/\$[0-9a-z]+/g,ro={},eh=yn(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),th=yn(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),nh=yn(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),rh=yn(function(e,t,n){return e.forEach(r=>{const a=t(r);r.replaceWith(a,n)}),e},"replaceByFn"),ah=yn(function(e,t){if(typeof e!="string")return e;const n=t.groups();return e=e.replace(Yd,r=>{const a=r.replace(/\$/,"");return n.hasOwnProperty(a)?n[a].text():r}),e},"subDollarSign");ro.replaceWith=function(e,t={}){let n=this.fullPointer;const r=this;if(this.uncache(),typeof e=="function")return rh(r,e,t);const a=r.docs[0];if(!a)return r;const o=t.possessives&&a[a.length-1].tags.has("Possessive"),i=t.case&&eh(a[0].text);e=ah(e,r);const s=this.update(n);n=n.map(p=>p.slice(0,3));const u=(s.docs[0]||[]).map(p=>Array.from(p.tags)),c=s.docs[0][0].pre,d=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),r.insertAfter(e),s.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction+").contractions().expand(),r.delete(s),o){const p=r.docs[0],b=p[p.length-1];b.tags.has("Possessive")||(b.text+="'s",b.normal+="'s",b.tags.add("Possessive"))}if(c&&r.docs[0]&&(r.docs[0][0].pre=c),d&&r.docs[0]){const p=r.docs[0][r.docs[0].length-1];p.post.trim()||(p.post=d)}const h=r.toView(n).compute(["index","freeze","lexicon"]);if(h.world.compute.preTagger&&h.compute("preTagger"),h.compute("unfreeze"),t.tags&&h.terms().forEach((p,b)=>{p.tagSafe(u[b])}),!h.docs[0]||!h.docs[0][0])return h;if(t.case){const p=i?th:nh;h.docs[0][0].text=p(h.docs[0][0].text)}return h};ro.replace=function(e,t,n){if(e&&!t)return this.replaceWith(e,n);const r=this.match(e);return r.found?(this.soften(),r.replaceWith(t,n)):this};var oh=Object.defineProperty,Au=l((e,t)=>oh(e,"name",{value:t,configurable:!0}),"r$1j");const ih=Au(function(e,t){const n=e.length-1,r=e[n],a=e[n-t];a&&r&&(a.post+=r.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},"repairPunct"),sh=Au(function(e,t){t.forEach(n=>{const[r,a,o]=n,i=o-a;e[r]&&(o===e[r].length&&o>1&&ih(e[r],i),e[r].splice(a,i))});for(let n=e.length-1;n>=0;n-=1)if(e[n].length===0&&(e.splice(n,1),n===e.length&&e[n-1])){const r=e[n-1],a=r[r.length-1];a&&(a.post=a.post.trimEnd())}return e},"pluckOut");var uh=Object.defineProperty,xu=l((e,t)=>uh(e,"name",{value:t,configurable:!0}),"s$1l");const lh=xu(function(e,t){return e=e.map(n=>{const[r]=n;return t[r]&&t[r].forEach(a=>{const o=a[2]-a[1];n[1]<=a[1]&&n[2]>=a[2]&&(n[2]-=o)}),n}),e.forEach((n,r)=>{if(n[1]===0&&n[2]==0)for(let a=r+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(n=>n[2]-n[1]>0),e=e.map(n=>(n[3]=null,n[4]=null,n)),e},"fixPointers"),ja={remove:xu(function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let n=this.all(),r=this;e&&(n=this,r=this.match(e));const a=!n.ptrs;r.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction").contractions().expand();let o=n.fullPointer;const i=r.fullPointer.reverse(),s=sh(this.document,i),u=t(i);return o=lh(o,u),n.ptrs=o,n.document=s,n.compute("index"),a&&(n.ptrs=void 0),e?n.toView(o):(this.ptrs=[],n.none())},"remove")};ja.delete=ja.remove;var ch=Object.defineProperty,pt=l((e,t)=>ch(e,"name",{value:t,configurable:!0}),"e$1c");const dn={pre:pt(function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(n=>{const r=n[0];t===!0?r.pre+=e:r.pre=e}),this)},"pre"),post:pt(function(e,t){if(e===void 0){const n=this.docs[this.docs.length-1];return n[n.length-1].post}return this.docs.forEach(n=>{const r=n[n.length-1];t===!0?r.post+=e:r.post=e}),this},"post"),trim:pt(function(){if(!this.found)return this;const e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();const n=e[e.length-1],r=n[n.length-1];return r.post=r.post.trimEnd(),this},"trim"),hyphenate:pt(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.pre=""),e[n+1]&&(t.post="-")})}),this},"hyphenate"),dehyphenate:pt(function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(n=>{e.test(n.post)&&(n.post=" ")})}),this},"dehyphenate"),toQuotations:pt(function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toQuotations"),toParentheses:pt(function(e,t){return e=e||"(",t=t||")",this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toParentheses")};dn.deHyphenate=dn.dehyphenate;dn.toQuotation=dn.toQuotations;var dh=Object.defineProperty,$n=l((e,t)=>dh(e,"name",{value:t,configurable:!0}),"o$1M");const hh=$n((e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,"alpha"),ph=$n((e,t)=>{const n=e.normal.trim().length,r=t.normal.trim().length;return n<r?1:n>r?-1:0},"length"),fh=$n((e,t)=>e.words<t.words?1:e.words>t.words?-1:0,"wordCount"),gh=$n((e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,"sequential"),mh=$n(function(e){const t={};return e.forEach(n=>{t[n.normal]=t[n.normal]||0,t[n.normal]+=1}),e.sort((n,r)=>{const a=t[n.normal],o=t[r.normal];return a<o?1:a>o?-1:0}),e},"byFreq"),Zr={alpha:hh,length:ph,wordCount:fh,sequential:gh,byFreq:mh};var vh=Object.defineProperty,$r=l((e,t)=>vh(e,"name",{value:t,configurable:!0}),"a$1L");const bh=new Set(["index","sequence","seq","sequential","chron","chronological"]),yh=new Set(["freq","frequency","topk","repeats"]),$h=new Set(["alpha","alphabetical"]),wh=$r(function(e,t){let n=e.fullPointer;return n=n.sort((r,a)=>(r=e.update([r]),a=e.update([a]),t(r,a))),e.ptrs=n,e},"customSort"),Ph=$r(function(e){const{docs:t,pointer:n}=this;if(this.uncache(),typeof e=="function")return wh(this,e);e=e||"alpha";const r=n||t.map((o,i)=>[i]);let a=t.map((o,i)=>({index:i,words:o.length,normal:o.map(s=>s.machine||s.normal||"").join(" "),pointer:r[i]}));return bh.has(e)&&(e="sequential"),$h.has(e)&&(e="alpha"),yh.has(e)?(a=Zr.byFreq(a),this.update(a.map(o=>o.pointer))):typeof Zr[e]=="function"?(a=a.sort(Zr[e]),this.update(a.map(o=>o.pointer))):this},"sort"),kh=$r(function(){let e=this.pointer||this.docs.map((t,n)=>[n]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},"reverse"),jh=$r(function(){const e=new Set;return this.filter(t=>{const n=t.text("machine");return e.has(n)?!1:(e.add(n),!0)})},"unique"),Ah={unique:jh,reverse:kh,sort:Ph};var xh=Object.defineProperty,wr=l((e,t)=>xh(e,"name",{value:t,configurable:!0}),"o$1L");const Ch=wr(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Cu=wr(function(e,t){if(e.length>0){const n=e[e.length-1],r=n[n.length-1];/ /.test(r.post)===!1&&(r.post+=" ")}return e=e.concat(t),e},"combineDocs"),Nh=wr(function(e,t){if(e.document===t.document){const n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Cu(e.document,t.docs),e.all()},"combineViews"),Oh={concat:wr(function(e){if(typeof e=="string"){const t=this.fromText(e);if(!this.found||!this.ptrs)this.document=this.document.concat(t.document);else{const n=this.fullPointer,r=n[n.length-1][0];this.document.splice(r,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return Nh(this,e);if(Ch(e)){const t=Cu(this.document,e);return this.document=t,this.all()}return this},"concat")};var Th=Object.defineProperty,Nu=l((e,t)=>Th(e,"name",{value:t,configurable:!0}),"n$$");const Ih=Nu(function(){return this.ptrs=this.fullPointer,this},"harden"),Dh=Nu(function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},"soften"),Eh={harden:Ih,soften:Dh};var Hh=Object.defineProperty,Gh=l((e,t)=>Hh(e,"name",{value:t,configurable:!0}),"r$1g");const Fh=Object.assign({},Md,kt,ro,ja,dn,Ah,Oh,Eh),Vh=Gh(function(e){Object.assign(e.prototype,Fh)},"addAPI");var zh=Object.defineProperty,Sh=l((e,t)=>zh(e,"name",{value:t,configurable:!0}),"d$P");const Bh={id:Sh(function(e){const t=e.docs;for(let n=0;n<t.length;n+=1)for(let r=0;r<t[n].length;r+=1){const a=t[n][r];a.id=a.id||ju(a)}},"id")},Mh={api:Vh,compute:Bh},Lh=[{word:"@",out:["at"]},{word:"arent",out:["are","not"]},{word:"alot",out:["a","lot"]},{word:"brb",out:["be","right","back"]},{word:"cannot",out:["can","not"]},{word:"dun",out:["do","not"]},{word:"can't",out:["can","not"]},{word:"shan't",out:["should","not"]},{word:"won't",out:["will","not"]},{word:"that's",out:["that","is"]},{word:"what's",out:["what","is"]},{word:"let's",out:["let","us"]},{word:"dunno",out:["do","not","know"]},{word:"gonna",out:["going","to"]},{word:"gotta",out:["have","got","to"]},{word:"gimme",out:["give","me"]},{word:"outta",out:["out","of"]},{word:"tryna",out:["trying","to"]},{word:"gtg",out:["got","to","go"]},{word:"im",out:["i","am"]},{word:"imma",out:["I","will"]},{word:"imo",out:["in","my","opinion"]},{word:"irl",out:["in","real","life"]},{word:"ive",out:["i","have"]},{word:"rn",out:["right","now"]},{word:"tbh",out:["to","be","honest"]},{word:"wanna",out:["want","to"]},{word:"c'mere",out:["come","here"]},{word:"c'mon",out:["come","on"]},{word:"shoulda",out:["should","have"]},{word:"coulda",out:["coulda","have"]},{word:"woulda",out:["woulda","have"]},{word:"musta",out:["must","have"]},{word:"tis",out:["it","is"]},{word:"twas",out:["it","was"]},{word:"y'know",out:["you","know"]},{word:"ne'er",out:["never"]},{word:"o'er",out:["over"]},{after:"ll",out:["will"]},{after:"ve",out:["have"]},{after:"re",out:["are"]},{after:"m",out:["am"]},{before:"c",out:["ce"]},{before:"m",out:["me"]},{before:"n",out:["ne"]},{before:"qu",out:["que"]},{before:"s",out:["se"]},{before:"t",out:["tu"]},{word:"shouldnt",out:["should","not"]},{word:"couldnt",out:["could","not"]},{word:"wouldnt",out:["would","not"]},{word:"hasnt",out:["has","not"]},{word:"wasnt",out:["was","not"]},{word:"isnt",out:["is","not"]},{word:"cant",out:["can","not"]},{word:"dont",out:["do","not"]},{word:"wont",out:["will","not"]},{word:"howd",out:["how","did"]},{word:"whatd",out:["what","did"]},{word:"whend",out:["when","did"]},{word:"whered",out:["where","did"]}],Kh={st:!0,nd:!0,rd:!0,th:!0,am:!0,pm:!0,max:!0,"°":!0,s:!0,e:!0,er:!0,ère:!0,ème:!0},Jh={one:{contractions:Lh,numberSuffixes:Kh}};var Wh=Object.defineProperty,qh=l((e,t)=>Wh(e,"name",{value:t,configurable:!0}),"a$1J");const Xr=qh(function(e,t,n){const[r,a]=t;!n||n.length===0||(n=n.map((o,i)=>(o.implicit=o.text,o.machine=o.text,o.pre="",o.post="",o.text="",o.normal="",o.index=[r,a+i],o)),n[0]&&(n[0].pre=e[r][a].pre,n[n.length-1].post=e[r][a].post,n[0].text=e[r][a].text,n[0].normal=e[r][a].normal),e[r].splice(a,1,...n))},"insertContraction");var Rh=Object.defineProperty,Uh=l((e,t)=>Rh(e,"name",{value:t,configurable:!0}),"t$M");const Qh=/'/,_h=new Set(["what","how","when","where","why"]),Zh=new Set(["be","go","start","think","need"]),Xh=new Set(["been","gone"]),Yh=Uh(function(e,t){const n=e[t].normal.split(Qh)[0];if(_h.has(n))return[n,"did"];if(e[t+1]){if(Xh.has(e[t+1].normal))return[n,"had"];if(Zh.has(e[t+1].normal))return[n,"would"]}return null},"_apostropheD");var ep=Object.defineProperty,tp=l((e,t)=>ep(e,"name",{value:t,configurable:!0}),"r$1d");const np=tp(function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},"apostropheT");var rp=Object.defineProperty,ao=l((e,t)=>rp(e,"name",{value:t,configurable:!0}),"s$1h");const oo=/'/,ap=/(e|é|aison|sion|tion)$/,op=/(age|isme|acle|ege|oire)$/,ip=ao((e,t)=>{const n=e[t].normal.split(oo)[1];return n&&n.endsWith("e")?["la",n]:["le",n]},"preL"),sp=ao((e,t)=>{const n=e[t].normal.split(oo)[1];return n&&ap.test(n)&&!op.test(n)?["du",n]:n&&n.endsWith("s")?["des",n]:["de",n]},"preD"),up=ao((e,t)=>["je",e[t].normal.split(oo)[1]],"preJ"),Yr={preJ:up,preL:ip,preD:sp};var lp=Object.defineProperty,cp=l((e,t)=>lp(e,"name",{value:t,configurable:!0}),"u$1F");const dp=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,hp=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,pp=/^[0-9]{3}-[0-9]{4}$/,fp=cp(function(e,t){const n=e[t];let r=n.text.match(dp);return r!==null?n.tags.has("PhoneNumber")===!0||pp.test(n.text)?null:[r[1],"to",r[2]]:(r=n.text.match(hp),r!==null?[r[1],"to",r[4]]:null)},"numberRange");var gp=Object.defineProperty,mp=l((e,t)=>gp(e,"name",{value:t,configurable:!0}),"o$1G");const vp=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,bp=mp(function(e,t,n){const r=n.model.one.numberSuffixes||{},a=e[t].text.match(vp);if(a!==null){const o=a[2].toLowerCase().trim();return r.hasOwnProperty(o)?null:[a[1],o]}return null},"numberUnit");var yp=Object.defineProperty,Ge=l((e,t)=>yp(e,"name",{value:t,configurable:!0}),"i$1K");const ei=/'/,$p=/^[0-9][^-–—]*[-–—].*?[0-9]/,ti=Ge(function(e,t,n,r){const a=t.update();a.document=[e];let o=n+r;n>0&&(n-=1),e[o]&&(o+=1),a.ptrs=[[0,n,o]]},"reTag"),ni={t:Ge((e,t)=>np(e,t),"t"),d:Ge((e,t)=>Yh(e,t),"d")},ri={j:Ge((e,t)=>Yr.preJ(e,t),"j"),l:Ge((e,t)=>Yr.preL(e,t),"l"),d:Ge((e,t)=>Yr.preD(e,t),"d")},wp=Ge(function(e,t,n,r){for(let a=0;a<e.length;a+=1){const o=e[a];if(o.word===t.normal)return o.out;if(r!==null&&r===o.after)return[n].concat(o.out);if(n!==null&&n===o.before&&r&&r.length>2)return o.out.concat(r)}return null},"knownOnes"),ea=Ge(function(e,t){const n=t.fromText(e.join(" "));return n.compute(["id","alias"]),n.docs[0]},"toDocs"),Pp=Ge(function(e,t){for(let n=t+1;n<5&&e[n];n+=1)if(e[n].normal==="been")return["there","has"];return["there","is"]},"thereHas"),kp=Ge(e=>{const{world:t,document:n}=e,{model:r,methods:a}=t,o=r.one.contractions||[];n.forEach((i,s)=>{for(let u=i.length-1;u>=0;u-=1){let c=null,d=null;if(ei.test(i[u].normal)===!0){const p=i[u].normal.split(ei);c=p[0],d=p[1]}let h=wp(o,i[u],c,d);if(!h&&ni.hasOwnProperty(d)&&(h=ni[d](i,u,t)),!h&&ri.hasOwnProperty(c)&&(h=ri[c](i,u)),c==="there"&&d==="s"&&(h=Pp(i,u)),h){h=ea(h,e),Xr(n,[s,u],h),ti(n[s],e,u,h.length);continue}if($p.test(i[u].normal)){h=fp(i,u),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag(h,"NumberRange",t),h[2]&&h[2].tags.has("Time")&&a.one.setTag([h[0]],"Time",t,null,"time-range"),ti(n[s],e,u,h.length));continue}h=bp(i,u,t),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag([h[1]],"Unit",t,null,"contraction-unit"))}})},"contractions"),jp={contractions:kp},Ap={model:Jh,compute:jp,hooks:["contractions"]};var xp=Object.defineProperty,Ou=l((e,t)=>xp(e,"name",{value:t,configurable:!0}),"i$1J");const ai=Ou(function(e){const t=e.world,{model:n,methods:r}=e.world,a=r.one.setTag,{frozenLex:o}=n.one,i=n.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){const c=s[u],d=c.machine||c.normal;if(i[d]!==void 0&&s[u+1]){const h=u+i[d]-1;for(let p=h;p>u;p-=1){const b=s.slice(u,p+1),x=b.map(G=>G.machine||G.normal).join(" ");if(o.hasOwnProperty(x)===!0){a(b,o[x],t,!1,"1-frozen-multi-lexicon"),b.forEach(G=>G.frozen=!0);continue}}}if(o[d]!==void 0&&o.hasOwnProperty(d)){a([c],o[d],t,!1,"1-freeze-lexicon"),c.frozen=!0;continue}}})},"freeze"),Cp=Ou(function(e){return e.docs.forEach(t=>{t.forEach(n=>{delete n.frozen})}),e},"unfreeze"),Np={frozen:ai,freeze:ai,unfreeze:Cp};var Op=Object.defineProperty,io=l((e,t)=>Op(e,"name",{value:t,configurable:!0}),"t$J");const oi=io(e=>"\x1B[34m"+e+"\x1B[0m","blue"),ii=io(e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m","dim"),si=io(function(e){e.docs.forEach(t=>{console.log(oi(`
2
2
  ┌─────────`)),t.forEach(n=>{let r=` ${ii("│")} `;const a=n.implicit||n.text||"-";n.frozen===!0?r+=`${oi(a)} ❄️`:r+=ii(a),console.log(r)})})},"debug");var Tp=Object.defineProperty,ui=l((e,t)=>Tp(e,"name",{value:t,configurable:!0}),"r$1b");const Ip={compute:Np,mutate:ui(e=>{const t=e.methods.one;t.termMethods.isFrozen=n=>n.frozen===!0,t.debug.freeze=si,t.debug.frozen=si},"mutate"),api:ui(function(e){e.prototype.freeze=function(){return this.docs.forEach(t=>{t.forEach(n=>{n.frozen=!0})}),this},e.prototype.unfreeze=function(){this.compute("unfreeze")},e.prototype.isFrozen=function(){return this.match("@isFrozen+")}},"api"),hooks:["freeze"]};var Dp=Object.defineProperty,Ep=l((e,t)=>Dp(e,"name",{value:t,configurable:!0}),"m$R");const Hp=Ep(function(e,t,n){const{model:r,methods:a}=n,o=a.one.setTag,i=r.one._multiCache||{},{lexicon:s}=r.one||{},u=e[t],c=u.machine||u.normal;if(i[c]!==void 0&&e[t+1]){const d=t+i[c]-1;for(let h=d;h>t;h-=1){const p=e.slice(t,h+1);if(p.length<=1)return!1;const b=p.map(x=>x.machine||x.normal).join(" ");if(s.hasOwnProperty(b)===!0){const x=s[b];return o(p,x,n,!1,"1-multi-lexicon"),x&&x.length===2&&(x[0]==="PhrasalVerb"||x[1]==="PhrasalVerb")&&o([p[1]],"Particle",n,!1,"1-phrasal-particle"),!0}}return!1}return null},"multiWord");var Gp=Object.defineProperty,Fp=l((e,t)=>Gp(e,"name",{value:t,configurable:!0}),"c$1H");const li=/^(under|over|mis|re|un|dis|semi|pre|post)-?/,Vp=new Set(["Verb","Infinitive","PastTense","Gerund","PresentTense","Adjective","Participle"]),zp=Fp(function(e,t,n){const{model:r,methods:a}=n,o=a.one.setTag,{lexicon:i}=r.one,s=e[t],u=s.machine||s.normal;if(i[u]!==void 0&&i.hasOwnProperty(u))return o([s],i[u],n,!1,"1-lexicon"),!0;if(s.alias){const c=s.alias.find(d=>i.hasOwnProperty(d));if(c)return o([s],i[c],n,!1,"1-lexicon-alias"),!0}if(li.test(u)===!0){const c=u.replace(li,"");if(i.hasOwnProperty(c)&&c.length>3&&Vp.has(i[c]))return o([s],i[c],n,!1,"1-lexicon-prefix"),!0}return null},"checkLexicon");var Sp=Object.defineProperty,Bp=l((e,t)=>Sp(e,"name",{value:t,configurable:!0}),"i$1I");const Mp=Bp(function(e){const t=e.world;e.docs.forEach(n=>{for(let r=0;r<n.length;r+=1)if(n[r].tags.size===0){let a=null;a=a||Hp(n,r,t),a=a||zp(n,r,t)}})},"lexicon"),Lp={lexicon:Mp};var Kp=Object.defineProperty,Jp=l((e,t)=>Kp(e,"name",{value:t,configurable:!0}),"s$1e");const Wp=Jp(function(e){const t={},n={};return Object.keys(e).forEach(r=>{const a=e[r];r=r.toLowerCase().trim(),r=r.replace(/'s\b/,"");const o=r.split(/ /);o.length>1&&(n[o[0]]===void 0||o.length>n[o[0]])&&(n[o[0]]=o.length),t[r]=t[r]||a}),delete t[""],delete t[null],delete t[" "],{lex:t,_multi:n}},"expand"),qp={one:{expandLexicon:Wp}};var Rp=Object.defineProperty,Up=l((e,t)=>Rp(e,"name",{value:t,configurable:!0}),"s$1d");const Qp=Up(function(e,t=!1){const n=this.world(),{methods:r,model:a}=n;if(!e)return;if(Object.keys(e).forEach(s=>{typeof e[s]=="string"&&e[s].startsWith("#")&&(e[s]=e[s].replace(/^#/,""))}),t===!0){const{lex:s,_multi:u}=r.one.expandLexicon(e,n);Object.assign(a.one._multiCache,u),Object.assign(a.one.frozenLex,s);return}if(r.two.expandLexicon){const{lex:s,_multi:u}=r.two.expandLexicon(e,n);Object.assign(a.one.lexicon,s),Object.assign(a.one._multiCache,u)}const{lex:o,_multi:i}=r.one.expandLexicon(e,n);Object.assign(a.one.lexicon,o),Object.assign(a.one._multiCache,i)},"addWords"),_p={addWords:Qp},Zp={one:{lexicon:{},_multiCache:{},frozenLex:{}}},Xp={model:Zp,methods:qp,compute:Lp,lib:_p,hooks:["lexicon"]};var Yp=Object.defineProperty,Tu=l((e,t)=>Yp(e,"name",{value:t,configurable:!0}),"p$18");const ef=Tu(function(e,t){const{methods:n,model:r}=t;return n.one.tokenize.splitTerms(e,r).map(a=>n.one.tokenize.splitWhitespace(a,r)).map(a=>a.text.toLowerCase())},"tokenize"),Iu=Tu(function(e,t){const n=[{}],r=[null],a=[0],o=[];let i=0;e.forEach(function(s){let u=0;const c=ef(s,t);for(let d=0;d<c.length;d++){const h=c[d];n[u]&&n[u].hasOwnProperty(h)?u=n[u][h]:(i++,n[u][h]=i,n[i]={},u=i,r[i]=null)}r[u]=[c.length]});for(const s in n[0])i=n[0][s],a[i]=0,o.push(i);for(;o.length;){const s=o.shift(),u=Object.keys(n[s]);for(let c=0;c<u.length;c+=1){const d=u[c],h=n[s][d];for(o.push(h),i=a[s];i>0&&!n[i].hasOwnProperty(d);)i=a[i];if(n.hasOwnProperty(i)){const p=n[i][d];a[h]=p,r[p]&&(r[h]=r[h]||[],r[h]=r[h].concat(r[p]))}else a[h]=0}}return{goNext:n,endAs:r,failTo:a}},"buildTrie");var tf=Object.defineProperty,so=l((e,t)=>tf(e,"name",{value:t,configurable:!0}),"u$1B");const nf=so(function(e,t,n){let r=0;const a=[];for(let o=0;o<e.length;o++){const i=e[o][n.form]||e[o].normal;for(;r>0&&(t.goNext[r]===void 0||!t.goNext[r].hasOwnProperty(i));)r=t.failTo[r]||0;if(t.goNext[r].hasOwnProperty(i)&&(r=t.goNext[r][i],t.endAs[r])){const s=t.endAs[r];for(let u=0;u<s.length;u++){const c=s[u],d=e[o-c+1],[h,p]=d.index;a.push([h,p,p+c,d.id])}}}return a},"scanWords"),rf=so(function(e,t){for(let n=0;n<e.length;n+=1)if(t.has(e[n])===!0)return!1;return!0},"cacheMiss"),af=so(function(e,t,n){let r=[];n.form=n.form||"normal";const a=e.docs;if(!t.goNext||!t.goNext[0])return console.error("Compromise invalid lookup trie"),e.none();const o=Object.keys(t.goNext[0]);for(let i=0;i<a.length;i++){if(e._cache&&e._cache[i]&&rf(o,e._cache[i])===!0)continue;const s=a[i],u=nf(s,t,n);u.length>0&&(r=r.concat(u))}return e.update(r)},"scan");var of=Object.defineProperty,Du=l((e,t)=>of(e,"name",{value:t,configurable:!0}),"r$19");const sf=Du(e=>Object.prototype.toString.call(e)==="[object Object]","isObject");function Eu(e){e.prototype.lookup=function(t,n={}){if(!t)return this.none();typeof t=="string"&&(t=[t]);const r=sf(t)?t:Iu(t,this.world);let a=af(this,r,n);return a=a.settle(),a}}l(Eu,"b$h");Du(Eu,"default");var uf=Object.defineProperty,Hu=l((e,t)=>uf(e,"name",{value:t,configurable:!0}),"u$1A");const ta=Hu((e,t)=>{for(let n=e.length-1;n>=0;n-=1)if(e[n]!==t)return e=e.slice(0,n+1),e;return e},"truncate"),lf=Hu(function(e){return e.goNext=e.goNext.map(t=>{if(Object.keys(t).length!==0)return t}),e.goNext=ta(e.goNext,void 0),e.failTo=ta(e.failTo,0),e.endAs=ta(e.endAs,null),e},"compress");var cf=Object.defineProperty,df=l((e,t)=>cf(e,"name",{value:t,configurable:!0}),"t$H");const Aa={buildTrie:df(function(e){const t=Iu(e,this.world());return lf(t)},"buildTrie")};Aa.compile=Aa.buildTrie;const hf={api:Eu,lib:Aa};var pf=Object.defineProperty,Ut=l((e,t)=>pf(e,"name",{value:t,configurable:!0}),"c$1F");const ci=Ut(function(e,t){return t&&e.forEach(n=>{const r=n[0];t[r]&&(n[0]=t[r][0],n[1]+=t[r][1],n[2]+=t[r][1])}),e},"relPointer"),Gu=Ut(function(e,t){let{ptrs:n}=e;const{byGroup:r}=e;return n=ci(n,t),Object.keys(r).forEach(a=>{r[a]=ci(r[a],t)}),{ptrs:n,byGroup:r}},"fixPointers"),wn=Ut(function(e,t,n){const r=n.methods.one;return typeof e=="number"&&(e=String(e)),typeof e=="string"&&(e=r.killUnicode(e,n),e=r.parseMatch(e,t,n)),e},"parseRegs"),Fu=Ut(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Pn=Ut(e=>e&&Fu(e)&&e.isView===!0,"isView"),kn=Ut(e=>e&&Fu(e)&&e.isNet===!0,"isNet");var ff=Object.defineProperty,jn=l((e,t)=>ff(e,"name",{value:t,configurable:!0}),"u$1y");const gf=jn(function(e,t,n){const r=this.methods.one;if(Pn(e))return this.intersection(e);if(kn(e))return this.sweep(e,{tagger:!1}).view.settle();e=wn(e,n,this.world);const a={regs:e,group:t},o=r.match(this.docs,a,this._cache),{ptrs:i,byGroup:s}=Gu(o,this.fullPointer),u=this.toView(i);return u._groups=s,u},"match"),mf=jn(function(e,t,n){const r=this.methods.one;if(Pn(e))return this.intersection(e).eq(0);if(kn(e))return this.sweep(e,{tagger:!1,matchOne:!0}).view;e=wn(e,n,this.world);const a={regs:e,group:t,justOne:!0},o=r.match(this.docs,a,this._cache),{ptrs:i,byGroup:s}=Gu(o,this.fullPointer),u=this.toView(i);return u._groups=s,u},"matchOne"),vf=jn(function(e,t,n){const r=this.methods.one;if(Pn(e))return this.intersection(e).fullPointer.length>0;if(kn(e))return this.sweep(e,{tagger:!1}).view.found;e=wn(e,n,this.world);const a={regs:e,group:t,justOne:!0};return r.match(this.docs,a,this._cache).ptrs.length>0},"has"),bf=jn(function(e,t,n){const r=this.methods.one;if(Pn(e))return this.filter(u=>u.intersection(e).found);if(kn(e)){const u=this.sweep(e,{tagger:!1}).view.settle();return this.if(u)}e=wn(e,n,this.world);const a={regs:e,group:t,justOne:!0};let o=this.fullPointer;const i=this._cache||[];o=o.filter((u,c)=>{const d=this.update([u]);return r.match(d.docs,a,i[c]).ptrs.length>0});const s=this.update(o);return this._cache&&(s._cache=o.map(u=>i[u[0]])),s},"ifFn"),yf=jn(function(e,t,n){const{methods:r}=this,a=r.one;if(Pn(e))return this.filter(s=>!s.intersection(e).found);if(kn(e)){const s=this.sweep(e,{tagger:!1}).view.settle();return this.ifNo(s)}e=wn(e,n,this.world);const o=this._cache||[],i=this.filter((s,u)=>{const c={regs:e,group:t,justOne:!0};return a.match(s.docs,c,o[u]).ptrs.length===0});return this._cache&&(i._cache=i.ptrs.map(s=>o[s[0]])),i},"ifNo"),$f={matchOne:mf,match:gf,has:vf,if:bf,ifNo:yf};var wf=Object.defineProperty,An=l((e,t)=>wf(e,"name",{value:t,configurable:!0}),"h$1h");const Pf=An(function(e,t,n){const{indexN:r}=this.methods.one.pointer,a=[],o=r(this.fullPointer);Object.keys(o).forEach(s=>{const u=o[s].sort((c,d)=>c[1]>d[1]?1:-1)[0];u[1]>0&&a.push([u[0],0,u[1]])});const i=this.toView(a);return e?i.match(e,t,n):i},"before"),kf=An(function(e,t,n){const{indexN:r}=this.methods.one.pointer,a=[],o=r(this.fullPointer),i=this.document;Object.keys(o).forEach(u=>{const c=o[u].sort((p,b)=>p[1]>b[1]?-1:1)[0],[d,,h]=c;h<i[d].length&&a.push([d,h,i[d].length])});const s=this.toView(a);return e?s.match(e,t,n):s},"after"),jf=An(function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[e.length-1].end=!0;const r=this.fullPointer;return this.forEach((a,o)=>{const i=a.before(e,t);if(i.found){const s=i.terms();r[o][1]-=s.length,r[o][3]=s.docs[0][0].id}}),this.update(r)},"growLeft"),Af=An(function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[0].start=!0;const r=this.fullPointer;return this.forEach((a,o)=>{const i=a.after(e,t);if(i.found){const s=i.terms();r[o][2]+=s.length,r[o][4]=null}}),this.update(r)},"growRight"),xf=An(function(e,t,n){return this.growRight(e,t,n).growLeft(e,t,n)},"grow"),Cf={before:Pf,after:kf,growLeft:jf,growRight:Af,grow:xf};var Nf=Object.defineProperty,Pr=l((e,t)=>Nf(e,"name",{value:t,configurable:!0}),"l$1f");const Vu=Pr(function(e,t){return[e[0],e[1],t[2]]},"combine"),Of=Pr(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),uo=Pr((e,t,n)=>typeof e=="string"||Of(e)?t.match(e,n):e||t.none(),"getDoc"),lo=Pr(function(e,t){const[n,r,a]=e;return t.document[n]&&t.document[n][r]&&(e[3]=e[3]||t.document[n][r].id,t.document[n][a-1]&&(e[4]=e[4]||t.document[n][a-1].id)),e},"addIds"),Wt={};Wt.splitOn=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=uo(e,this,t).fullPointer,a=n(this.fullPointer,r);let o=[];return a.forEach(i=>{o.push(i.passthrough),o.push(i.before),o.push(i.match),o.push(i.after)}),o=o.filter(i=>i),o=o.map(i=>lo(i,this)),this.update(o)};Wt.splitBefore=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=uo(e,this,t).fullPointer,a=n(this.fullPointer,r);for(let i=0;i<a.length;i+=1)!a[i].after&&a[i+1]&&a[i+1].before&&a[i].match&&a[i].match[0]===a[i+1].before[0]&&(a[i].after=a[i+1].before,delete a[i+1].before);let o=[];return a.forEach(i=>{o.push(i.passthrough),o.push(i.before),i.match&&i.after?o.push(Vu(i.match,i.after)):o.push(i.match)}),o=o.filter(i=>i),o=o.map(i=>lo(i,this)),this.update(o)};Wt.splitAfter=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=uo(e,this,t).fullPointer,a=n(this.fullPointer,r);let o=[];return a.forEach(i=>{o.push(i.passthrough),i.before&&i.match?o.push(Vu(i.before,i.match)):(o.push(i.before),o.push(i.match)),o.push(i.after)}),o=o.filter(i=>i),o=o.map(i=>lo(i,this)),this.update(o)};Wt.split=Wt.splitAfter;var Tf=Object.defineProperty,hr=l((e,t)=>Tf(e,"name",{value:t,configurable:!0}),"r$18");const If=hr(function(e,t){return!e||!t||e[0]!==t[0]?!1:e[2]===t[1]},"isNeighbour"),di=hr(function(e,t,n){const r=e.world,a=r.methods.one.parseMatch;t=t||".$",n=n||"^.";const o=a(t,{},r),i=a(n,{},r);o[o.length-1].end=!0,i[0].start=!0;const s=e.fullPointer,u=[s[0]];for(let c=1;c<s.length;c+=1){const d=u[u.length-1],h=s[c],p=e.update([d]),b=e.update([h]);If(d,h)&&p.has(o)&&b.has(i)?u[u.length-1]=[d[0],d[1],h[2],d[3],h[4]]:u.push(h)}return e.update(u)},"mergeIf"),Df={joinIf:hr(function(e,t){return di(this,e,t)},"joinIf"),join:hr(function(){return di(this)},"join")};var Ef=Object.defineProperty,Hf=l((e,t)=>Ef(e,"name",{value:t,configurable:!0}),"e$17");const De=Object.assign({},$f,Cf,Wt,Df);De.lookBehind=De.before;De.lookBefore=De.before;De.lookAhead=De.after;De.lookAfter=De.after;De.notIf=De.ifNo;const Gf=Hf(function(e){Object.assign(e.prototype,De)},"matchAPI");var Ff=Object.defineProperty,kr=l((e,t)=>Ff(e,"name",{value:t,configurable:!0}),"o$1B");const Vf=/(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/,zf=/([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/,Sf=/ /g,Bf=kr(e=>/^[![^]*(<[^<]*>)?\(/.test(e)&&/\)[?\]+*$~]*$/.test(e),"isBlock"),hi=kr(e=>/^[![^]*(<[^<]*>)?\//.test(e)&&/\/[?\]+*$~]*$/.test(e),"isReg"),pi=kr(function(e){return e=e.map(t=>t.trim()),e=e.filter(t=>t),e},"cleanUp"),Mf=kr(function(e){const t=e.split(Vf);let n=[];t.forEach(a=>{if(hi(a)){n.push(a);return}n=n.concat(a.split(zf))}),n=pi(n);let r=[];return n.forEach(a=>{Bf(a)||hi(a)?r.push(a):r=r.concat(a.split(Sf))}),r=pi(r),r},"parseBlocks");var Lf=Object.defineProperty,jt=l((e,t)=>Lf(e,"name",{value:t,configurable:!0}),"o$1A");const fi=/\{([0-9]+)?(, *[0-9]*)?\}/,gi=/&&/,Kf=new RegExp(/^<\s*(\S+)\s*>/),mi=jt(e=>e.charAt(0).toUpperCase()+e.substring(1),"titleCase"),be=jt(e=>e.charAt(e.length-1),"end"),ce=jt(e=>e.charAt(0),"start"),St=jt(e=>e.substring(1),"stripStart"),Bt=jt(e=>e.substring(0,e.length-1),"stripEnd"),tn=jt(function(e){return e=St(e),e=Bt(e),e},"stripBoth"),zu=jt(function(e,t){const n={};for(let r=0;r<2;r+=1){if(be(e)==="$"&&(n.end=!0,e=Bt(e)),ce(e)==="^"&&(n.start=!0,e=St(e)),be(e)==="?"&&(n.optional=!0,e=Bt(e)),(ce(e)==="["||be(e)==="]")&&(n.group=null,ce(e)==="["&&(n.groupStart=!0),be(e)==="]"&&(n.groupEnd=!0),e=e.replace(/^\[/,""),e=e.replace(/\]$/,""),ce(e)==="<")){const a=Kf.exec(e);a.length>=2&&(n.group=a[1],e=e.replace(a[0],""))}if(be(e)==="+"&&(n.greedy=!0,e=Bt(e)),e!=="*"&&be(e)==="*"&&e!=="\\*"&&(n.greedy=!0,e=Bt(e)),ce(e)==="!"&&(n.negative=!0,e=St(e)),ce(e)==="~"&&be(e)==="~"&&e.length>2&&(e=tn(e),n.fuzzy=!0,n.min=t.fuzzy||.85,/\(/.test(e)===!1))return n.word=e,n;if(ce(e)==="/"&&be(e)==="/")return e=tn(e),t.caseSensitive&&(n.use="text"),n.regex=new RegExp(e),n;if(fi.test(e)===!0&&(e=e.replace(fi,(a,o,i)=>(i===void 0?(n.min=Number(o),n.max=Number(o)):(i=i.replace(/, */,""),o===void 0?(n.min=0,n.max=Number(i)):(n.min=Number(o),n.max=Number(i||999))),n.greedy=!0,n.min||(n.optional=!0),""))),ce(e)==="("&&be(e)===")"){gi.test(e)?(n.choices=e.split(gi),n.operator="and"):(n.choices=e.split("|"),n.operator="or"),n.choices[0]=St(n.choices[0]);const a=n.choices.length-1;n.choices[a]=Bt(n.choices[a]),n.choices=n.choices.map(o=>o.trim()),n.choices=n.choices.filter(o=>o),n.choices=n.choices.map(o=>o.split(/ /g).map(i=>zu(i,t))),e=""}if(ce(e)==="{"&&be(e)==="}"){if(e=tn(e),n.root=e,/\//.test(e)){const a=n.root.split(/\//);n.root=a[0],n.pos=a[1],n.pos==="adj"&&(n.pos="Adjective"),n.pos=n.pos.charAt(0).toUpperCase()+n.pos.substr(1).toLowerCase(),a[2]!==void 0&&(n.sense=a[2])}return n}if(ce(e)==="<"&&be(e)===">")return e=tn(e),n.chunk=mi(e),n.greedy=!0,n;if(ce(e)==="%"&&be(e)==="%")return e=tn(e),n.switch=e,n}return ce(e)==="#"?(n.tag=St(e),n.tag=mi(n.tag),n):ce(e)==="@"?(n.method=St(e),n):e==="."?(n.anything=!0,n):e==="*"?(n.anything=!0,n.greedy=!0,n.optional=!0,n):(e&&(e=e.replace("\\*","*"),e=e.replace("\\.","."),t.caseSensitive?n.use="text":e=e.toLowerCase(),n.word=e),n)},"parseToken");var Jf=Object.defineProperty,Wf=l((e,t)=>Jf(e,"name",{value:t,configurable:!0}),"c$1D");const qf=/[a-z0-9][-–—][a-z]/i,Rf=Wf(function(e,t){const n=t.model.one.prefixes;for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.word&&qf.test(a.word)){let o=a.word.split(/[-–—]/g);if(n.hasOwnProperty(o[0]))continue;o=o.filter(i=>i).reverse(),e.splice(r,1),o.forEach(i=>{const s=Object.assign({},a);s.word=i,e.splice(r,0,s)})}}return e},"splitHyphens");var Uf=Object.defineProperty,jr=l((e,t)=>Uf(e,"name",{value:t,configurable:!0}),"e$16");const vi=jr(function(e,t){const{all:n}=t.methods.two.transform.verb||{},r=e.root;return n?n(r,t.model):[]},"addVerbs"),bi=jr(function(e,t){const{all:n}=t.methods.two.transform.noun||{};return n?n(e.root,t.model):[e.root]},"addNoun"),yi=jr(function(e,t){const{all:n}=t.methods.two.transform.adjective||{};return n?n(e.root,t.model):[e.root]},"addAdjective"),Qf=jr(function(e,t){return e=e.map(n=>{if(n.root)if(t.methods.two&&t.methods.two.transform){let r=[];n.pos?n.pos==="Verb"?r=r.concat(vi(n,t)):n.pos==="Noun"?r=r.concat(bi(n,t)):n.pos==="Adjective"&&(r=r.concat(yi(n,t))):(r=r.concat(vi(n,t)),r=r.concat(bi(n,t)),r=r.concat(yi(n,t))),r=r.filter(a=>a),r.length>0&&(n.operator="or",n.fastOr=new Set(r))}else n.machine=n.root,delete n.id,delete n.root;return n}),e},"inflectRoot");var _f=Object.defineProperty,Ar=l((e,t)=>_f(e,"name",{value:t,configurable:!0}),"f$1t");const Zf=Ar(function(e){let t=0,n=null;for(let r=0;r<e.length;r++){const a=e[r];a.groupStart===!0&&(n=a.group,n===null&&(n=String(t),t+=1)),n!==null&&(a.group=n),a.groupEnd===!0&&(n=null)}return e},"nameGroups"),Xf=Ar(function(e){return e.map(t=>{if(t.choices!==void 0){if(t.operator!=="or"||t.fuzzy===!0)return t;t.choices.every(n=>{if(n.length!==1)return!1;const r=n[0];return r.fuzzy===!0||r.start||r.end?!1:r.word!==void 0&&r.negative!==!0&&r.optional!==!0&&r.method!==!0})===!0&&(t.fastOr=new Set,t.choices.forEach(n=>{t.fastOr.add(n[0].word)}),delete t.choices)}return t})},"doFastOrMode"),Yf=Ar(function(e){return e.map(t=>(t.fuzzy&&t.choices&&t.choices.forEach(n=>{n.length===1&&n[0].word&&(n[0].fuzzy=!0,n[0].min=t.min)}),t))},"fuzzyOr"),eg=Ar(function(e){return e=Zf(e),e=Xf(e),e=Yf(e),e},"postProcess");var tg=Object.defineProperty,ng=l((e,t)=>tg(e,"name",{value:t,configurable:!0}),"m$I");const rg=ng(function(e,t,n){if(e==null||e==="")return[];t=t||{},typeof e=="number"&&(e=String(e));let r=Mf(e);return r=r.map(a=>zu(a,t)),r=Rf(r,n),r=Qf(r,n),r=eg(r,t),r},"syntax");var ag=Object.defineProperty,Su=l((e,t)=>ag(e,"name",{value:t,configurable:!0}),"f$1s");const og=Su(function(e,t){for(const n of t)if(e.has(n))return!0;return!1},"anyIntersection"),ig=Su(function(e,t){for(let n=0;n<e.length;n+=1){const r=e[n];if(!(r.optional===!0||r.negative===!0||r.fuzzy===!0)){if(r.word!==void 0&&t.has(r.word)===!1||r.tag!==void 0&&t.has("#"+r.tag)===!1)return!0;if(r.fastOr&&og(r.fastOr,t)===!1)return!1}}return!1},"failFast");var sg=Object.defineProperty,Bu=l((e,t)=>sg(e,"name",{value:t,configurable:!0}),"g$t");const ug=Bu(function(e,t){const n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;const a=(r>n?r:n)+1;if(Math.abs(n-r)>(a||100))return a||100;const o=[];for(let p=0;p<a;p++)o[p]=[p],o[p].length=a;for(let p=0;p<a;p++)o[0][p]=p;let i,s,u,c,d,h;for(let p=1;p<=n;++p)for(s=e[p-1],i=1;i<=r;++i){if(p===i&&o[p][i]>4)return n;u=t[i-1],c=s===u?0:1,d=o[p-1][i]+1,(h=o[p][i-1]+1)<d&&(d=h),(h=o[p-1][i-1]+c)<d&&(d=h),p>1&&i>1&&s===t[i-2]&&e[p-2]===u&&(h=o[p-2][i-2]+c)<d?o[p][i]=h:o[p][i]=d}return o[n][r]},"editDistance"),lg=Bu(function(e,t,n=3){if(e===t)return 1;if(e.length<n||t.length<n)return 0;const r=ug(e,t),a=Math.max(e.length,t.length);return 1-(a===0?0:r/a)},"fuzzyMatch");var cg=Object.defineProperty,Q=l((e,t)=>cg(e,"name",{value:t,configurable:!0}),"t$G");const dg=/([\u0022\uFF02\u0027\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F])/,hg=/([\u0022\uFF02\u0027\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4])/,$i=/^[-–—]$/,wi=/ [-–—]{1,3} /,Ee=Q((e,t)=>e.post.indexOf(t)!==-1,"hasPost"),hn={hasQuote:Q(e=>dg.test(e.pre)||hg.test(e.post),"hasQuote"),hasComma:Q(e=>Ee(e,","),"hasComma"),hasPeriod:Q(e=>Ee(e,".")===!0&&Ee(e,"...")===!1,"hasPeriod"),hasExclamation:Q(e=>Ee(e,"!"),"hasExclamation"),hasQuestionMark:Q(e=>Ee(e,"?")||Ee(e,"¿"),"hasQuestionMark"),hasEllipses:Q(e=>Ee(e,"..")||Ee(e,"…"),"hasEllipses"),hasSemicolon:Q(e=>Ee(e,";"),"hasSemicolon"),hasColon:Q(e=>Ee(e,":"),"hasColon"),hasSlash:Q(e=>/\//.test(e.text),"hasSlash"),hasHyphen:Q(e=>$i.test(e.post)||$i.test(e.pre),"hasHyphen"),hasDash:Q(e=>wi.test(e.post)||wi.test(e.pre),"hasDash"),hasContraction:Q(e=>!!e.implicit,"hasContraction"),isAcronym:Q(e=>e.tags.has("Acronym"),"isAcronym"),isKnown:Q(e=>e.tags.size>0,"isKnown"),isTitleCase:Q(e=>new RegExp("^\\p{Lu}[a-z'\\u00C0-\\u00FF]","u").test(e.text),"isTitleCase"),isUpperCase:Q(e=>new RegExp("^\\p{Lu}+$","u").test(e.text),"isUpperCase")};hn.hasQuotation=hn.hasQuote;var pg=Object.defineProperty,co=l((e,t)=>pg(e,"name",{value:t,configurable:!0}),"s$1b");let R=co(function(){},"wrapMatch");const fg=co(function(e,t,n,r){if(t.anything===!0)return!0;if(t.start===!0&&n!==0||t.end===!0&&n!==r-1)return!1;if(t.id!==void 0&&t.id===e.id)return!0;if(t.word!==void 0)return t.use?t.word===e[t.use]:e.machine!==null&&e.machine===t.word||e.alias!==void 0&&e.alias.hasOwnProperty(t.word)||t.fuzzy===!0&&(t.word===e.root||lg(t.word,e.normal)>=t.min)||e.alias&&e.alias.some(a=>a===t.word)?!0:t.word===e.text||t.word===e.normal;if(t.tag!==void 0)return e.tags.has(t.tag)===!0;if(t.method!==void 0)return typeof hn[t.method]=="function"&&hn[t.method](e)===!0;if(t.pre!==void 0)return e.pre&&e.pre.includes(t.pre);if(t.post!==void 0)return e.post&&e.post.includes(t.post);if(t.regex!==void 0){let a=e.normal;return t.use&&(a=e[t.use]),t.regex.test(a)}if(t.chunk!==void 0)return e.chunk===t.chunk;if(t.switch!==void 0)return e.switch===t.switch;if(t.machine!==void 0)return e.normal===t.machine||e.machine===t.machine||e.root===t.machine;if(t.sense!==void 0)return e.sense===t.sense;if(t.fastOr!==void 0){if(t.pos&&!e.tags.has(t.pos))return null;const a=e.root||e.implicit||e.machine||e.normal;return t.fastOr.has(a)||t.fastOr.has(e.text)}return t.choices!==void 0?t.operator==="and"?t.choices.every(a=>R(e,a,n,r)):t.choices.some(a=>R(e,a,n,r)):!1},"doesMatch");R=co(function(e,t,n,r){const a=fg(e,t,n,r);return t.negative===!0?!a:a},"wrapMatch");var gg=Object.defineProperty,ho=l((e,t)=>gg(e,"name",{value:t,configurable:!0}),"i$1A");const mg=ho(function(e,t){const n=Object.assign({},e.regs[e.r],{start:!1,end:!1}),r=e.t;for(;e.t<e.terms.length;e.t+=1){if(t&&R(e.terms[e.t],t,e.start_i+e.t,e.phrase_length))return e.t;const a=e.t-r+1;if(n.max!==void 0&&a===n.max)return e.t;if(R(e.terms[e.t],n,e.start_i+e.t,e.phrase_length)===!1)return n.min!==void 0&&a<n.min?null:e.t}return e.t},"getGreedy"),vg=ho(function(e,t){let n=e.t;if(!t)return e.terms.length;for(;n<e.terms.length;n+=1)if(R(e.terms[n],t,e.start_i+n,e.phrase_length)===!0)return n;return null},"greedyTo"),bg=ho(function(e,t){if(e.end===!0&&e.greedy===!0&&t.start_i+t.t<t.phrase_length-1){const n=Object.assign({},e,{end:!1});if(R(t.terms[t.t],n,t.start_i+t.t,t.phrase_length)===!0)return!0}return!1},"isEndGreedy");var yg=Object.defineProperty,$g=l((e,t)=>yg(e,"name",{value:t,configurable:!0}),"u$1s");const xr=$g(function(e,t){return e.groups[e.inGroup]||(e.groups[e.inGroup]={start:t,length:0}),e.groups[e.inGroup]},"getGroup");var wg=Object.defineProperty,Pg=l((e,t)=>wg(e,"name",{value:t,configurable:!0}),"i$1z");const kg=Pg(function(e){const{regs:t}=e,n=t[e.r],r=vg(e,t[e.r+1]);if(r===null||r===0||n.min!==void 0&&r-e.t<n.min)return null;if(n.max!==void 0&&r-e.t>n.max)return e.t=e.t+n.max,!0;if(e.hasGroup===!0){const a=xr(e,e.t);a.length=r-e.t}return e.t=r,!0},"doAstrix");var jg=Object.defineProperty,po=l((e,t)=>jg(e,"name",{value:t,configurable:!0}),"s$1a");const Ag=po(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),Mu=po(function(e,t=0){const n=e.regs[e.r];let r=!1;for(let a=0;a<n.choices.length;a+=1){const o=n.choices[a];if(!Ag(o))return!1;if(r=o.every((i,s)=>{let u=0;const c=e.t+s+t+u;if(e.terms[c]===void 0)return!1;const d=R(e.terms[c],i,c+e.start_i,e.phrase_length);if(d===!0&&i.greedy===!0)for(let h=1;h<e.terms.length;h+=1){const p=e.terms[c+h];if(p)if(R(p,i,e.start_i+h,e.phrase_length)===!0)u+=1;else break}return t+=u,d}),r){t+=o.length;break}}return r&&n.greedy===!0?Mu(e,t):t},"doOrBlock"),xg=po(function(e){let t=0;return e.regs[e.r].choices.every(n=>{const r=n.every((a,o)=>{const i=e.t+o;return e.terms[i]===void 0?!1:R(e.terms[i],a,i,e.phrase_length)});return r===!0&&n.length>t&&(t=n.length),r})===!0?t:!1},"doAndBlock");var Cg=Object.defineProperty,Ng=l((e,t)=>Cg(e,"name",{value:t,configurable:!0}),"i$1y");const Og=Ng(function(e){const{regs:t}=e,n=t[e.r],r=Mu(e);if(r){if(n.negative===!0)return null;if(e.hasGroup===!0){const a=xr(e,e.t);a.length+=r}if(n.end===!0){const a=e.phrase_length;if(e.t+e.start_i+r!==a)return null}return e.t+=r,!0}else if(!n.optional)return null;return!0},"orBlock");var Tg=Object.defineProperty,Ig=l((e,t)=>Tg(e,"name",{value:t,configurable:!0}),"i$1x");const Dg=Ig(function(e){const{regs:t}=e,n=t[e.r],r=xg(e);if(r){if(n.negative===!0)return null;if(e.hasGroup===!0){const a=xr(e,e.t);a.length+=r}if(n.end===!0){const a=e.phrase_length-1;if(e.t+e.start_i!==a)return null}return e.t+=r,!0}else if(!n.optional)return null;return!0},"andBlock");var Eg=Object.defineProperty,Hg=l((e,t)=>Eg(e,"name",{value:t,configurable:!0}),"m$F");const Gg=Hg(function(e,t,n){let r=0;for(let a=e.t;a<e.terms.length;a+=1){let o=R(e.terms[a],t,e.start_i+e.t,e.phrase_length);if(o||n&&(o=R(e.terms[a],n,e.start_i+e.t,e.phrase_length),o)||(r+=1,t.max!==void 0&&r===t.max))break}return r===0||t.min&&t.min>r?!1:(e.t+=r,!0)},"negGreedy");var Fg=Object.defineProperty,Vg=l((e,t)=>Fg(e,"name",{value:t,configurable:!0}),"g$s");const zg=Vg(function(e){const{regs:t}=e,n=t[e.r],r=Object.assign({},n);if(r.negative=!1,R(e.terms[e.t],r,e.start_i+e.t,e.phrase_length))return!1;if(n.optional){const a=t[e.r+1];a&&(R(e.terms[e.t],a,e.start_i+e.t,e.phrase_length)?e.r+=1:a.optional&&t[e.r+2]&&R(e.terms[e.t],t[e.r+2],e.start_i+e.t,e.phrase_length)&&(e.r+=2))}return n.greedy?Gg(e,r,t[e.r+1]):(e.t+=1,!0)},"doNegative");var Sg=Object.defineProperty,Bg=l((e,t)=>Sg(e,"name",{value:t,configurable:!0}),"c$1w");const Mg=Bg(function(e){const{regs:t}=e,n=t[e.r],r=e.terms[e.t],a=R(r,t[e.r+1],e.start_i+e.t,e.phrase_length);if(n.negative||a){const o=e.terms[e.t+1];(!o||!R(o,t[e.r+1],e.start_i+e.t,e.phrase_length))&&(e.r+=1)}},"foundOptional");var Lg=Object.defineProperty,Kg=l((e,t)=>Lg(e,"name",{value:t,configurable:!0}),"e$12");const Jg=Kg(function(e){const{regs:t,phrase_length:n}=e,r=t[e.r];return e.t=mg(e,t[e.r+1]),e.t===null||r.min&&r.min>e.t||r.end===!0&&e.start_i+e.t!==n?null:!0},"greedyMatch");var Wg=Object.defineProperty,qg=l((e,t)=>Wg(e,"name",{value:t,configurable:!0}),"o$1u");const Rg=qg(function(e){const t=e.terms[e.t],n=e.regs[e.r];if(t.implicit&&e.terms[e.t+1]){if(!e.terms[e.t+1].implicit)return;n.word===t.normal&&(e.t+=1),n.method==="hasContraction"&&(e.t+=1)}},"contractionSkip");var Ug=Object.defineProperty,Lu=l((e,t)=>Ug(e,"name",{value:t,configurable:!0}),"e$11");const Qg=Lu(function(e,t){const n=e.regs[e.r],r=xr(e,t);e.t>1&&n.greedy?r.length+=e.t-t:r.length++},"setGroup"),na=Lu(function(e){const{regs:t}=e,n=t[e.r],r=e.terms[e.t],a=e.t;return n.optional&&t[e.r+1]&&n.negative?!0:(n.optional&&t[e.r+1]&&Mg(e),r.implicit&&e.terms[e.t+1]&&Rg(e),e.t+=1,n.end===!0&&e.t!==e.terms.length&&n.greedy!==!0||n.greedy===!0&&!Jg(e)?null:(e.hasGroup===!0&&Qg(e,a),!0))},"simpleMatch");var _g=Object.defineProperty,Zg=l((e,t)=>_g(e,"name",{value:t,configurable:!0}),"s$19");const fo=Zg(function(e,t,n,r){if(e.length===0||t.length===0)return null;const a={t:0,terms:e,r:0,regs:t,groups:{},start_i:n,phrase_length:r,inGroup:null};for(;a.r<t.length;a.r+=1){const s=t[a.r];if(a.hasGroup=!!s.group,a.hasGroup===!0?a.inGroup=s.group:a.inGroup=null,!a.terms[a.t]){if(t.slice(a.r).some(u=>!u.optional)===!1)break;return null}if(s.anything===!0&&s.greedy===!0){if(!kg(a))return null;continue}if(s.choices!==void 0&&s.operator==="or"){if(!Og(a))return null;continue}if(s.choices!==void 0&&s.operator==="and"){if(!Dg(a))return null;continue}if(s.anything===!0){if(s.negative&&s.anything||!na(a))return null;continue}if(bg(s,a)===!0){if(!na(a))return null;continue}if(s.negative){if(!zg(a))return null;continue}if(R(a.terms[a.t],s,a.start_i+a.t,a.phrase_length)===!0){if(!na(a))return null;continue}if(s.optional!==!0)return null}const o=[null,n,a.t+n];if(o[1]===o[2])return null;const i={};return Object.keys(a.groups).forEach(s=>{const u=a.groups[s],c=n+u.start;i[s]=[null,c,c+u.length]}),{pointer:o,groups:i}},"tryHere");var Xg=Object.defineProperty,Yg=l((e,t)=>Xg(e,"name",{value:t,configurable:!0}),"u$1q");const em=Yg(function(e,t){const n=[],r={};return e.length===0?{ptrs:n,byGroup:r}:(typeof t=="number"&&(t=String(t)),t?e.forEach(a=>{a.groups[t]&&n.push(a.groups[t])}):e.forEach(a=>{n.push(a.pointer),Object.keys(a.groups).forEach(o=>{r[o]=r[o]||[],r[o].push(a.groups[o])})}),{ptrs:n,byGroup:r})},"getGroup");var tm=Object.defineProperty,nm=l((e,t)=>tm(e,"name",{value:t,configurable:!0}),"r$16");const rm=nm(function(e,t,n){return e=e.filter(r=>{const[a,o,i]=r.pointer,s=n[a].slice(o,i);for(let u=0;u<s.length;u+=1){const c=s.slice(u);if(fo(c,t,u,s.length)!==null)return!1}return!0}),e},"notIf");var am=Object.defineProperty,go=l((e,t)=>am(e,"name",{value:t,configurable:!0}),"a$1u");const Ku=go(function(e,t){return e.pointer[0]=t,Object.keys(e.groups).forEach(n=>{e.groups[n][0]=t}),e},"addSentence"),om=go(function(e,t,n){let r=fo(e,t,0,e.length);return r?(r=Ku(r,n),r):null},"handleStart"),im=go(function(e,t,n){n=n||[];const{regs:r,group:a,justOne:o}=t;let i=[];if(!r||r.length===0)return{ptrs:[],byGroup:{}};const s=r.filter(u=>u.optional!==!0&&u.negative!==!0).length;e:for(let u=0;u<e.length;u+=1){const c=e[u];if(!(n[u]&&ig(r,n[u]))){if(r[0].start===!0){const d=om(c,r,u,a);d&&i.push(d);continue}for(let d=0;d<c.length;d+=1){const h=c.slice(d);if(h.length<s)break;let p=fo(h,r,d,c.length);if(p){if(p=Ku(p,u),i.push(p),o===!0)break e;const b=p.pointer[2];Math.abs(b-1)>d&&(d=Math.abs(b-1))}}}}return r[r.length-1].end===!0&&(i=i.filter(u=>{const c=u.pointer[0];return e[c].length===u.pointer[2]})),t.notIf&&(i=rm(i,t.notIf,e)),i=em(i,a),i.ptrs.forEach(u=>{const[c,d,h]=u;u[3]=e[c][d].id,u[4]=e[c][h-1].id}),i},"runMatch"),sm={one:{termMethods:hn,parseMatch:rg,match:im}};var um=Object.defineProperty,lm=l((e,t)=>um(e,"name",{value:t,configurable:!0}),"c$1r");const cm={parseMatch:lm(function(e,t){const n=this.world(),r=n.methods.one.killUnicode;return r&&(e=r(e,n)),n.methods.one.parseMatch(e,t,n)},"parseMatch")},dm={api:Gf,methods:sm,lib:cm};var hm=Object.defineProperty,Cr=l((e,t)=>hm(e,"name",{value:t,configurable:!0}),"i$1v");const pm=/^\../,fm=/^#./,gm=Cr(e=>(e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e=e.replace(/'/g,"&apos;"),e),"escapeXml"),mm=Cr(function(e){let t="",n="</span>";return e=gm(e),pm.test(e)?t=`<span class="${e.replace(/^\./,"")}"`:fm.test(e)?t=`<span id="${e.replace(/^#/,"")}"`:(t=`<${e}`,n=`</${e}>`),t+=">",{start:t,end:n}},"toTag"),vm=Cr(function(e,t){const n={},r={};return Object.keys(t).forEach(a=>{let o=t[a];const i=mm(a);typeof o=="string"&&(o=e.match(o)),o.docs.forEach(s=>{if(s.every(d=>d.implicit))return;const u=s[0].id;n[u]=n[u]||[],n[u].push(i.start);const c=s[s.length-1].id;r[c]=r[c]||[],r[c].push(i.end)})}),{starts:n,ends:r}},"getIndex"),bm=Cr(function(e){const{starts:t,ends:n}=vm(this,e);let r="";return this.docs.forEach(a=>{for(let o=0;o<a.length;o+=1){const i=a[o];t.hasOwnProperty(i.id)&&(r+=t[i.id].join("")),r+=i.pre||"",r+=i.text||"",n.hasOwnProperty(i.id)&&(r+=n[i.id].join("")),r+=i.post||""}}),r},"html"),ym={html:bm};var $m=Object.defineProperty,Ju=l((e,t)=>$m(e,"name",{value:t,configurable:!0}),"n$T");const Wu=/[,:;)\]*.?~!\u0022\uFF02\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4—-]+$/,xa=/^[(['"*~\uFF02\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F]+/,wm=/[,:;)('"\u201D\]]/,Pm=/^[-–—]$/,km=/ /,bt=Ju(function(e,t,n=!0){let r="";return e.forEach(a=>{let o=a.pre||"",i=a.post||"";t.punctuation==="some"&&(o=o.replace(xa,""),Pm.test(i)&&(i=" "),i=i.replace(wm,""),i=i.replace(/\?!+/,"?"),i=i.replace(/!+/,"!"),i=i.replace(/\?+/,"?"),i=i.replace(/\.{2,}/,""),a.tags.has("Abbreviation")&&(i=i.replace(/\./,""))),t.whitespace==="some"&&(o=o.replace(/\s/,""),i=i.replace(/\s+/," ")),t.keepPunct||(o=o.replace(xa,""),i==="-"?i=" ":i=i.replace(Wu,""));let s=a[t.form||"text"]||a.normal||"";t.form==="implicit"&&(s=a.implicit||a.text),t.form==="root"&&a.implicit&&(s=a.root||a.implicit||a.normal),(t.form==="machine"||t.form==="implicit"||t.form==="root")&&a.implicit&&(!i||!km.test(i))&&(i+=" "),r+=o+s+i}),n===!1&&(r=r.trim()),t.lowerCase===!0&&(r=r.toLowerCase()),r},"textFromTerms"),jm=Ju(function(e,t){let n="";if(!e||!e[0]||!e[0][0])return n;for(let r=0;r<e.length;r+=1)n+=bt(e[r],t,!0);if(t.keepSpace||(n=n.trim()),t.keepEndPunct===!1){e[0][0].tags.has("Emoticon")||(n=n.replace(xa,""));const r=e[e.length-1];r[r.length-1].tags.has("Emoticon")||(n=n.replace(Wu,"")),n.endsWith("'")&&!n.endsWith("s'")&&(n=n.replace(/'/,""))}return t.cleanWhitespace===!0&&(n=n.trim()),n},"textFromDoc"),st={text:{form:"text"},normal:{whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"normal"},machine:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"none",unicode:"some",form:"machine"},root:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"root"},implicit:{form:"implicit"}};st.clean=st.normal;st.reduced=st.root;var Am=Object.defineProperty,xm=l((e,t)=>Am(e,"name",{value:t,configurable:!0}),"h$18");const qu=[];let yt=0;for(;yt<64;)qu[yt]=0|Math.sin(++yt%Math.PI)*4294967296;const mo=xm(function(e){let t,n,r,a=decodeURI(encodeURI(e))+"€",o=a.length;const i=[t=1732584193,n=4023233417,~t,~n],s=[];for(e=--o/4+2|15,s[--e]=o*8;~o;)s[o>>2]|=a.charCodeAt(o)<<8*o--;for(yt=a=0;yt<e;yt+=16){for(o=i;a<64;o=[r=o[3],t+((r=o[0]+[t&n|~t&r,r&t|~r&n,t^n^r,n^(t|~r)][o=a>>4]+qu[a]+~~s[yt|[a,5*a+1,3*a+5,7*a][o]&15])<<(o=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*o+a++%4])|r>>>-o),t,n])t=o[1]|0,n=o[2];for(a=4;a;)i[--a]+=o[a]}for(e="";a<32;)e+=(i[a>>3]>>(1^a++)*4&15).toString(16);return e},"md5");var Cm=Object.defineProperty,oe=l((e,t)=>Cm(e,"name",{value:t,configurable:!0}),"s$16");const Nm={text:!0,terms:!0},Pi={case:"none",unicode:"some",form:"machine",punctuation:"some"},ra=oe(function(e,t){return Object.assign({},e,t)},"merge"),Ze={text:oe(e=>bt(e,{keepPunct:!0},!1),"text"),normal:oe(e=>bt(e,ra(st.normal,{keepPunct:!0}),!1),"normal"),implicit:oe(e=>bt(e,ra(st.implicit,{keepPunct:!0}),!1),"implicit"),machine:oe(e=>bt(e,Pi,!1),"machine"),root:oe(e=>bt(e,ra(Pi,{form:"root"}),!1),"root"),hash:oe(e=>mo(bt(e,{keepPunct:!0},!1)),"hash"),offset:oe(e=>{const t=Ze.text(e).length;return{index:e[0].offset.index,start:e[0].offset.start,length:t}},"offset"),terms:oe(e=>e.map(t=>{const n=Object.assign({},t);return n.tags=Array.from(t.tags),n}),"terms"),confidence:oe((e,t,n)=>t.eq(n).confidence(),"confidence"),syllables:oe((e,t,n)=>t.eq(n).syllables(),"syllables"),sentence:oe((e,t,n)=>t.eq(n).fullSentence().text(),"sentence"),dirty:oe(e=>e.some(t=>t.dirty===!0),"dirty")};Ze.sentences=Ze.sentence;Ze.clean=Ze.normal;Ze.reduced=Ze.root;const Om=oe(function(e,t){return t=t||{},typeof t=="string"&&(t={}),t=Object.assign({},Nm,t),t.offset&&e.compute("offset"),e.docs.map((n,r)=>{const a={};return Object.keys(t).forEach(o=>{t[o]&&Ze[o]&&(a[o]=Ze[o](n,e,r))}),a})},"toJSON"),Ca={json:oe(function(e){const t=Om(this,e);return typeof e=="number"?t[e]:t},"json")};Ca.data=Ca.json;var Tm=Object.defineProperty,Ru=l((e,t)=>Tm(e,"name",{value:t,configurable:!0}),"i$1t");const Im=Ru(()=>typeof window<"u"&&window.document,"isClientSide"),Dm=Ru(function(e){const t=this.methods.one.debug||{};return e&&t.hasOwnProperty(e)?(t[e](this),this):Im()?(t.clientSide(this),this):(t.tags(this),this)},"debug");var Em=Object.defineProperty,vo=l((e,t)=>Em(e,"name",{value:t,configurable:!0}),"f$1n");const Hm=vo(function(e){const t=e.pre||"",n=e.post||"";return t+e.text+n},"toText"),Gm=vo(function(e,t){const n={};return Object.keys(t).forEach(r=>{e.match(r).fullPointer.forEach(a=>{n[a[3]]={fn:t[r],end:a[2]}})}),n},"findStarts"),Uu=vo(function(e,t){const n=Gm(e,t);let r="";return e.docs.forEach((a,o)=>{for(let i=0;i<a.length;i+=1){const s=a[i];if(n.hasOwnProperty(s.id)){const{fn:u,end:c}=n[s.id],d=e.update([[o,i,c]]);r+=a[i].pre||"",r+=u(d),i=c-1,r+=a[i].post||""}else r+=Hm(s)}}),r},"wrap");var Fm=Object.defineProperty,Nr=l((e,t)=>Fm(e,"name",{value:t,configurable:!0}),"i$1s");const Vm=Nr(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),zm=Nr(function(e){const t={};return e.forEach(n=>{t[n]=t[n]||0,t[n]+=1}),Object.keys(t).map(n=>({normal:n,count:t[n]})).sort((n,r)=>n.count>r.count?-1:0)},"topk"),Sm=Nr(function(e){if(Vm(e))return Uu(this,e);if(e==="text")return this.text();if(e==="normal")return this.text("normal");if(e==="root")return this.text("root");if(e==="machine"||e==="reduced")return this.text("machine");if(e==="hash"||e==="md5")return mo(this.text());if(e==="json")return this.json();if(e==="offset"||e==="offsets")return this.compute("offset"),this.json({offset:!0});if(e==="array")return this.docs.map(t=>t.reduce((n,r)=>n+r.pre+r.text+r.post,"").trim()).filter(t=>t);if(e==="freq"||e==="frequency"||e==="topk")return zm(this.json({normal:!0}).map(t=>t.normal));if(e==="terms"){let t=[];return this.docs.forEach(n=>{let r=n.map(a=>a.text);r=r.filter(a=>a),t=t.concat(r)}),t}return e==="tags"?this.docs.map(t=>t.reduce((n,r)=>(n[r.implicit||r.normal]=Array.from(r.tags),n),{})):e==="debug"?this.debug():this.text()},"out"),Bm={debug:Dm,out:Sm,wrap:Nr(function(e){return Uu(this,e)},"wrap")};var Mm=Object.defineProperty,Qu=l((e,t)=>Mm(e,"name",{value:t,configurable:!0}),"n$P");const Lm=Qu(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Km={text:Qu(function(e){let t={};if(e&&typeof e=="string"&&st.hasOwnProperty(e)?t=Object.assign({},st[e]):e&&Lm(e)&&(t=Object.assign({},e)),t.keepSpace===void 0&&!this.isFull()&&(t.keepSpace=!1),t.keepEndPunct===void 0&&this.pointer){const n=this.pointer[0];n&&n[1]?t.keepEndPunct=!1:t.keepEndPunct=!0}return t.keepPunct===void 0&&(t.keepPunct=!0),t.keepSpace===void 0&&(t.keepSpace=!0),jm(this.docs,t)},"text")};var Jm=Object.defineProperty,Wm=l((e,t)=>Jm(e,"name",{value:t,configurable:!0}),"o$1r");const qm=Object.assign({},Bm,Km,Ca,ym),Rm=Wm(function(e){Object.assign(e.prototype,qm)},"addAPI");var Um=Object.defineProperty,Qm=l((e,t)=>Um(e,"name",{value:t,configurable:!0}),"l$15");const _m=Qm(function(e){console.log("%c -=-=- ","background-color:#6699cc;"),e.forEach(t=>{console.groupCollapsed(t.text());const n=t.docs[0].map(r=>{let a=r.text||"-";r.implicit&&(a="["+r.implicit+"]");const o="["+Array.from(r.tags).join(", ")+"]";return{text:a,tags:o}});console.table(n,["text","tags"]),console.groupEnd()})},"logClientSide");var Zm=Object.defineProperty,Se=l((e,t)=>Zm(e,"name",{value:t,configurable:!0}),"m$C");const Be="\x1B[0m",pe={green:Se(e=>"\x1B[32m"+e+Be,"green"),red:Se(e=>"\x1B[31m"+e+Be,"red"),blue:Se(e=>"\x1B[34m"+e+Be,"blue"),magenta:Se(e=>"\x1B[35m"+e+Be,"magenta"),cyan:Se(e=>"\x1B[36m"+e+Be,"cyan"),yellow:Se(e=>"\x1B[33m"+e+Be,"yellow"),black:Se(e=>"\x1B[30m"+e+Be,"black"),dim:Se(e=>"\x1B[2m"+e+Be,"dim"),i:Se(e=>"\x1B[3m"+e+Be,"i")};var Xm=Object.defineProperty,_u=l((e,t)=>Xm(e,"name",{value:t,configurable:!0}),"i$1q");const Ym=_u(function(e,t){return t.one.tagSet&&(e=e.map(n=>{if(!t.one.tagSet.hasOwnProperty(n))return n;const r=t.one.tagSet[n].color||"blue";return pe[r](n)})),e.join(", ")},"tagString"),e0=_u(function(e){const{docs:t,model:n}=e;t.length===0&&console.log(pe.blue(`
3
3
  ──────`)),t.forEach(r=>{console.log(pe.blue(`
4
4
  ┌─────────`)),r.forEach(a=>{const o=[...a.tags||[]];let i=a.text||"-";a.sense&&(i=`{${a.normal}/${a.sense}}`),a.implicit&&(i="["+a.implicit+"]"),i=pe.yellow(i);let s="'"+i+"'";if(a.reference){const c=e.update([a.reference]).text("normal");s+=` - ${pe.dim(pe.i("["+c+"]"))}`}s=s.padEnd(18);const u=pe.blue(" │ ")+pe.i(s)+" - "+Ym(o,n);console.log(u)})}),console.log(`
@@ -1 +1 @@
1
- var u=Object.defineProperty;var m=(n,o)=>u(n,"name",{value:o,configurable:!0});import{r as h}from"../packem_shared/affected-shas-BkXXecyi.js";import{r as w}from"../packem_shared/toolchain-juKl-WgV.js";var $=Object.defineProperty,a=m((n,o)=>$(n,"name",{value:o,configurable:!0}),"t");const S=a(async({argument:n,logger:o,options:r,runtime:l,visConfig:f,workspaceRoot:s})=>{const p=n[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const c=p.split(",").map(e=>e.trim()).filter(Boolean);if(c.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const t=h({defaultBase:f?.defaultBase,workspaceRoot:s}),d=r.base??t.base,g=r.head??t.head;!r.base&&!r.head&&o.info(`▸ Resolved affected refs from ${t.provider} (${t.notes.join("; ")})`),r.skipToolchain||o.info("▸ Toolchain pre-flight"),await w(s,f?.toolchain,{error:a(e=>{o.error(e)},"error"),info:a(e=>{o.info(e)},"info"),warn:a(e=>{o.warn(e)},"warn")},!!r.skipToolchain),r.install===!1?o.info("▸ Skipping install (--no-install)"):(o.info("▸ Installing dependencies"),await l.runCommand("install",{argv:["--ci","--frozen-lockfile"]}));for(const e of c){o.info(`▸ Running affected ${e} (base=${d}, head=${g})`);const i=[e,`--base=${d}`,`--head=${g}`,`--upstream=${String(r.upstream??"none")}`,`--downstream=${String(r.downstream??"deep")}`];r.parallel!==void 0&&i.push(`--parallel=${String(r.parallel)}`),r.partition&&i.push(`--partition=${String(r.partition)}`),r.query&&i.push(`--query=${String(r.query)}`),await l.runCommand("affected",{argv:i})}o.info("▸ CI pipeline complete")},"execute");export{S as default};
1
+ var u=Object.defineProperty;var m=(n,o)=>u(n,"name",{value:o,configurable:!0});import{r as h}from"../packem_shared/affected-shas-BdnlfiV1.js";import{r as w}from"../packem_shared/toolchain-DoG6b_G_.js";var $=Object.defineProperty,a=m((n,o)=>$(n,"name",{value:o,configurable:!0}),"t");const S=a(async({argument:n,logger:o,options:r,runtime:l,visConfig:f,workspaceRoot:s})=>{const p=n[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const c=p.split(",").map(e=>e.trim()).filter(Boolean);if(c.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const t=h({defaultBase:f?.defaultBase,workspaceRoot:s}),d=r.base??t.base,g=r.head??t.head;!r.base&&!r.head&&o.info(`▸ Resolved affected refs from ${t.provider} (${t.notes.join("; ")})`),r.skipToolchain||o.info("▸ Toolchain pre-flight"),await w(s,f?.toolchain,{error:a(e=>{o.error(e)},"error"),info:a(e=>{o.info(e)},"info"),warn:a(e=>{o.warn(e)},"warn")},!!r.skipToolchain),r.install===!1?o.info("▸ Skipping install (--no-install)"):(o.info("▸ Installing dependencies"),await l.runCommand("install",{argv:["--ci","--frozen-lockfile"]}));for(const e of c){o.info(`▸ Running affected ${e} (base=${d}, head=${g})`);const i=[e,`--base=${d}`,`--head=${g}`,`--upstream=${String(r.upstream??"none")}`,`--downstream=${String(r.downstream??"deep")}`];r.parallel!==void 0&&i.push(`--parallel=${String(r.parallel)}`),r.partition&&i.push(`--partition=${String(r.partition)}`),r.query&&i.push(`--query=${String(r.query)}`),await l.runCommand("affected",{argv:i})}o.info("▸ CI pipeline complete")},"execute");export{S as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,i as k}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
1
+ var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,l as k}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
@@ -1 +1 @@
1
- var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-Ta_yz2uP.js";var f=Object.defineProperty,d=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),n=p(t,o.check||!1,c,e);n!==0&&(process.exitCode=n)},"execute");export{u as default};
1
+ var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{R as l,M as p}from"../packem_shared/pm-runner-DmKT2FqF.js";var f=Object.defineProperty,d=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),n=p(t,o.check||!1,c,e);n!==0&&(process.exitCode=n)},"execute");export{u as default};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-Ta_yz2uP.js";var v=Object.defineProperty,x=i((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const w=x(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:l})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[t,...g]=o,n=l??process.cwd(),p=k(n,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),f=a.package?Array.isArray(a.package)?a.package:[a.package]:[],c=u(p,{additionalPackages:f,args:g,package:t,shellMode:a.shellMode||!1,silent:a.silent||!1},n,s,{offline:a.offline||!1});c!==0&&(process.exitCode=c)},"execute");export{w as default};
1
+ var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{R as k,B as u}from"../packem_shared/pm-runner-DmKT2FqF.js";var v=Object.defineProperty,x=i((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const w=x(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:l})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[t,...g]=o,n=l??process.cwd(),p=k(n,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),f=a.package?Array.isArray(a.package)?a.package:[a.package]:[],c=u(p,{additionalPackages:f,args:g,package:t,shellMode:a.shellMode||!1,silent:a.silent||!1},n,s,{offline:a.offline||!1});c!==0&&(process.exitCode=c)},"execute");export{w as default};
@@ -1,4 +1,4 @@
1
- var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,P as Y}from"../packem_shared/pm-runner-Ta_yz2uP.js";import{p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:p}=n;if(p!=="ERR_MODULE_NOT_FOUND"&&p!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
1
+ var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,P as Y}from"../packem_shared/pm-runner-DmKT2FqF.js";import{p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:p}=n;if(p!=="ERR_MODULE_NOT_FOUND"&&p!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
2
2
  ${y(e)}`);if(!await i(`${e} isn't installed. Install it now?`))throw new Error(`${e} install declined. Re-run \`vis ai heal accept\` after installing manually:
3
3
  ${y(e)}`);const r=await s(e,d);if(r.exitCode!==0)throw new Error(`Install of ${e} failed (exit ${String(r.exitCode)}). Install manually and retry:
4
4
  ${y(e)}`);return await l(e)},"loadOptionalSdk");var Z=Object.defineProperty,_=I((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=_(e=>{const t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`Expected GITHUB_REPOSITORY in "owner/repo" form, got: ${e}`);return{owner:e.slice(0,t),repo:e.slice(t+1)}},"splitGithubRepo"),te=_(async(e,t)=>{if(t.githubClient)return t.githubClient;const o=(await(t.loadSdk??L)("@octokit/rest")).Octokit;if(!o)throw new TypeError("Loaded `@octokit/rest` but no `Octokit` export was found. Reinstall the package or pin to a supported major.");return new o({auth:e})},"loadGithubClient"),oe=_(async(e,t,o)=>{if(o.gitlabClient)return o.gitlabClient;const i=(await(o.loadSdk??L)("@gitbeaker/rest")).Gitlab;if(!i)throw new TypeError("Loaded `@gitbeaker/rest` but no `Gitlab` export was found. Reinstall the package or pin to a supported major.");return new i({host:t,token:e})},"loadGitlabClient"),re=_(e=>e.replace(/\/api\/v\d+\/?$/,""),"apiBaseToHost"),ie=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(w=>B(w,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitHub: GITHUB_REPOSITORY (owner/repo) is not set.");if(!o.token)throw new Error("Cannot commit on GitHub: GITHUB_TOKEN is not set. Grant the workflow `contents: write` and pass the token through.");const{owner:r,repo:n}=ee(o.repo),p=await te(o.token,e),u=(await p.rest.git.getRef({owner:r,ref:`heads/${t}`,repo:n})).data.object.sha,h=(await p.rest.git.getCommit({commit_sha:u,owner:r,repo:n})).data.tree.sha,m=await Promise.all(i.map(async w=>{const v=O(l,w),E=await d(v),C=await p.rest.git.createBlob({content:Buffer.from(E,"utf8").toString("base64"),encoding:"base64",owner:r,repo:n});return{mode:"100644",path:w,sha:C.data.sha,type:"blob"}})),f=await p.rest.git.createTree({base_tree:h,owner:r,repo:n,tree:m}),b=await p.rest.git.createCommit({message:s,owner:r,parents:[u],repo:n,tree:f.data.sha});return await p.rest.git.updateRef({owner:r,ref:`heads/${t}`,repo:n,sha:b.data.sha}),{sha:b.data.sha,url:b.data.html_url}},"commitToGithub"),ae=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(m=>B(m,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitLab: CI_PROJECT_ID / CI_PROJECT_PATH is not set.");if(!o.token)throw new Error("Cannot commit on GitLab: no token. CI_JOB_TOKEN cannot push commits — set GITLAB_TOKEN to a PAT/project-token with `api` scope.");if(!o.apiBaseUrl)throw new Error("Cannot commit on GitLab: CI_API_V4_URL is not set.");const r=re(o.apiBaseUrl),n=await oe(o.token,r,e),p=await Promise.all(i.map(async m=>{const f=O(l,m);return{action:"update",content:await d(f),filePath:m}})),u=await n.Commits.create(o.repo,t,s,p),h=u.id??u.sha;if(!h)throw new Error("GitLab Commits.create returned no commit ID — cannot reference the new commit.");return{sha:h,url:u.web_url??u.webUrl}},"commitToGitlab"),ne=_(async e=>{if(e.files.length===0)throw new Error("Cannot commit: no files to include.");if(e.ciContext.provider==="github-actions")return await ie(e);if(e.ciContext.provider==="gitlab-ci")return await ae(e);throw new Error(`Cannot commit: unsupported CI provider \`${e.ciContext.provider}\`. Run \`vis ai heal accept\` from a recognised CI environment.`)},"commitFiles");var se=Object.defineProperty,g=I((e,t)=>se(e,"name",{value:t,configurable:!0}),"u");const G="/vis heal accept",ce=g(async e=>{if(!e)return;let t;try{t=await B(e,"utf8")}catch{return}const o=JSON.parse(t),i=o.comment?.body??"",s=o.comment?.user?.login??"",l=o.pull_request?.head?.repo?.full_name,d=o.pull_request?.base?.repo?.full_name??o.repository?.full_name,r=l!==void 0&&d!==void 0&&l!==d;return{actor:s,body:i,headRef:o.pull_request?.head?.ref,isFork:r}},"loadGithubTrigger"),le=g(e=>{const t=e.VIS_HEAL_TRIGGER_BODY,o=e.VIS_HEAL_TRIGGER_ACTOR;if(!(!t||!o))return{actor:o,body:t,headRef:e.VIS_HEAL_HEAD_REF,isFork:!1}},"loadGitlabTrigger"),de=g(e=>{const t=e.BUILDKITE_UNBLOCKER_EMAIL??e.BUILDKITE_UNBLOCKER;if(t)return{actor:t,body:G,headRef:e.BUILDKITE_BRANCH,isFork:!1}},"loadBuildkiteTrigger"),pe=g(async(e,t)=>{if(e.provider==="github-actions")return await ce(t.GITHUB_EVENT_PATH);if(e.provider==="gitlab-ci")return le(t);if(e.provider==="buildkite")return de(t)},"loadTrigger"),ue=g((e,t)=>{const o=t.BUILDKITE_REPO;if(!o)return;const i=/(?:^|@|\/\/)github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(o);if(i&&t.GITHUB_TOKEN)return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"github-actions",repo:`${i[1]}/${i[2]}`,sha:e.sha,token:t.GITHUB_TOKEN};const s=/\/\/([^/]*gitlab[^/]*)\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),l=s?null:/@([^/:]*gitlab[^/:]*):([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),d=s??l;if(d&&t.GITLAB_TOKEN){const r=d[1];return{apiBaseUrl:t.CI_API_V4_URL??`https://${r}/api/v4`,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"gitlab-ci",repo:`${d[2]}/${d[3]}`,sha:e.sha,token:t.GITLAB_TOKEN}}},"deriveBuildkiteCommitContext"),me=g(async e=>{const t=e.fetchImpl??globalThis.fetch,o=`${(e.apiBaseUrl??"https://api.github.com").replace(/\/+$/,"")}/repos/${e.repo}/pulls/${String(e.prNumber)}`;try{const i=await t(o,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}});return i.ok?(await i.json()).head?.ref:void 0}catch{return}},"fetchGithubHeadRef"),fe=g((e,t,o,i)=>{const s=t.map(l=>`- \`${l}\``).join(`
@@ -1,4 +1,4 @@
1
- var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,T as G,I as j,e as F}from"../packem_shared/Table-3pFgIUZ2-DABgc6rj.js";import{z as D}from"../packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-CfFWatGY.js";import{E as q,p as u}from"./bin.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
1
+ var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,T as G,I as j,e as F}from"../packem_shared/Table-DoSoazT6-DwnyTUsA.js";import{z as D}from"../packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-BkPUHA0z.js";import{F as q,p as u}from"./bin.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
2
2
  ${n.newString}`);s.push(`${d}diff`);for(const p of n.oldString.split(`
3
3
  `))s.push(`- ${p}`);for(const p of n.newString.split(`
4
4
  `))s.push(`+ ${p}`);s.push(d),r.push(s.join(`