@visulima/vis 2.0.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE.md +5395 -4307
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +6 -6
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
- package/dist/packem_chunks/agent-instructions.js +7 -7
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +87 -111
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +192 -217
- package/dist/packem_chunks/defineReleasePlugin.js +3 -3
- package/dist/packem_chunks/detect.js +8 -3
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_chunks/discord.js +4 -4
- package/dist/packem_chunks/dispatch.js +4 -4
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +11 -11
- package/dist/packem_chunks/git.js +3 -3
- package/dist/packem_chunks/group-tags.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +16 -16
- package/dist/packem_chunks/handler13.js +5 -5
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +8 -8
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -2
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +5 -5
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +2 -2
- package/dist/packem_chunks/handler38.js +6 -6
- package/dist/packem_chunks/handler39.js +8 -8
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +34 -34
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -4
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler44.js +2 -2
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +3 -3
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler50.js +6 -6
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +5 -5
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +4 -4
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +5 -5
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +3 -3
- package/dist/packem_chunks/handler61.js +21 -21
- package/dist/packem_chunks/handler62.js +12 -12
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +5 -5
- package/dist/packem_chunks/handler65.js +8 -8
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +21 -21
- package/dist/packem_chunks/handler68.js +21 -21
- package/dist/packem_chunks/handler69.js +30 -30
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +9 -9
- package/dist/packem_chunks/handler71.js +17 -17
- package/dist/packem_chunks/handler72.js +104 -104
- package/dist/packem_chunks/handler73.js +20 -20
- package/dist/packem_chunks/handler74.js +45 -45
- package/dist/packem_chunks/handler75.js +27 -3
- package/dist/packem_chunks/handler76.js +3 -27
- package/dist/packem_chunks/handler77.js +68 -68
- package/dist/packem_chunks/handler78.js +30 -30
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +9 -9
- package/dist/packem_chunks/heal.js +11 -11
- package/dist/packem_chunks/help-command.js +7 -63
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/index2.js +48 -802
- package/dist/packem_chunks/index3.js +3 -7
- package/dist/packem_chunks/index4.js +803 -134
- package/dist/packem_chunks/index5.js +7 -73
- package/dist/packem_chunks/index6.js +73 -0
- package/dist/packem_chunks/index7.js +135 -0
- package/dist/packem_chunks/interface.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +4 -4
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +3 -3
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +27 -27
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prompts.js +7 -7
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/slack.js +2 -2
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/success-walk.js +4 -4
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_chunks/webhook.js +1 -1
- package/dist/packem_chunks/workflow-templates.js +5 -5
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
- package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
- package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
- package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
- package/dist/packem_shared/advisories-CyDqzi5j.js +1 -0
- package/dist/packem_shared/affected-selection-DPQR-Bd3.js +1 -0
- package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
- package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
- package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
- package/dist/packem_shared/augment-COAiXSIx.js +4 -0
- package/dist/packem_shared/bin-wafzkjaB.js +1 -0
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
- package/dist/packem_shared/clean-DRiLimTx.js +1 -0
- package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
- package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
- package/dist/packem_shared/cyclonedx-C_ezHg8b.js +4 -0
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
- package/dist/packem_shared/docker-Br_iFmI-.js +59 -0
- package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
- package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
- package/dist/packem_shared/giget-CVyyR7x8.js +2 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
- package/dist/packem_shared/index-B4AjSxHU.js +1 -0
- package/dist/packem_shared/index-BisalDCf.js +39 -0
- package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
- package/dist/packem_shared/index-DXPSWMbG.js +1 -0
- package/dist/packem_shared/index.server-CwSgbeN7.js +2 -0
- package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
- package/dist/packem_shared/license-DvlYdo6T.js +1 -0
- package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
- package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
- package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
- package/dist/packem_shared/main-BjJN8kWj.js +1 -0
- package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
- package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
- package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
- package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
- package/dist/packem_shared/osv-bloom-5wDAoZ1e.js +2 -0
- package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
- package/dist/packem_shared/package-version-BJkg7-6H.js +4 -0
- package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
- package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
- package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
- package/dist/packem_shared/project-name-filter-BeREbPMI.js +7 -0
- package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
- package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
- package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
- package/dist/packem_shared/resolve-explicit-COmP7eqr.js +5 -0
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
- package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
- package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
- package/dist/packem_shared/s1ngularity-RZOHbGrE.js +1 -0
- package/dist/packem_shared/scan-progress-C9nMDLis.js +2 -0
- package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
- package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
- package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
- package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
- package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
- package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
- package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
- package/dist/packem_shared/tabs-BilwonkM.js +1 -0
- package/dist/packem_shared/target-merge-D1xbylFw.js +4 -0
- package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
- package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
- package/dist/packem_shared/typosquats-D8ppc5kr.js +1 -0
- package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
- package/dist/packem_shared/utils-DQFHJn72.js +1 -0
- package/dist/packem_shared/verify-D8wYvB85.js +1 -0
- package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
- package/dist/packem_shared/vis-user-error-jhNwmkZp.js +30 -0
- package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
- package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
- package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
- package/dist/release/core/changelog/index.d.ts +62 -2
- package/dist/release/core/package-managers/index.d.ts +25 -1
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.d.ts +47 -2
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.d.ts +100 -1
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +16 -1
- package/dist/release/plugin-sdk.js +1 -1
- package/dist/release/presets.js +1 -1
- package/dist/release/types.js +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +13 -13
- package/dist/packem_chunks/detect2.js +0 -8
- package/dist/packem_chunks/registry.js +0 -48
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
- package/dist/packem_shared/advisories-CCBGdU8U.js +0 -1
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +0 -1
- package/dist/packem_shared/affected-shas-PwkVbPch.js +0 -1
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +0 -68
- package/dist/packem_shared/ai-fix-DV5-dHBY.js +0 -43
- package/dist/packem_shared/augment-24KX2nkI.js +0 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +0 -1
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +0 -1
- package/dist/packem_shared/clean-DWjQl14S.js +0 -1
- package/dist/packem_shared/command-runtime-BLFPUYAT.js +0 -1
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
- package/dist/packem_shared/cyclonedx-C4KaVTn1.js +0 -4
- package/dist/packem_shared/dependency-scan-D_ona0Qm.js +0 -1
- package/dist/packem_shared/docker-DaVs-9wK.js +0 -59
- package/dist/packem_shared/en-D3CfXlO7.js +0 -27
- package/dist/packem_shared/failure-log-CTneNcio.js +0 -2
- package/dist/packem_shared/giget-CAxjpwew.js +0 -2
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +0 -1
- package/dist/packem_shared/index-BAe6e0XE.js +0 -1
- package/dist/packem_shared/index-CTMU29dI.js +0 -1
- package/dist/packem_shared/index-uBVnF4ji.js +0 -35
- package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
- package/dist/packem_shared/license-t5KnNX6v.js +0 -1
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +0 -2
- package/dist/packem_shared/lockfile-Bccery3L.js +0 -1
- package/dist/packem_shared/main-D_cam4hv.js +0 -1
- package/dist/packem_shared/manifests-BDkwiVbh.js +0 -1
- package/dist/packem_shared/min-release-age-OaYpLwux.js +0 -34
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +0 -1
- package/dist/packem_shared/native-config-sync-Ds1FtcrM.js +0 -21
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +0 -2
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
- package/dist/packem_shared/package-version-C47v64aB.js +0 -4
- package/dist/packem_shared/packument-HBVbyf7x.js +0 -1
- package/dist/packem_shared/pm-runner-C6eTANt1.js +0 -1
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +0 -7
- package/dist/packem_shared/provenance-D4Cza8cp.js +0 -1
- package/dist/packem_shared/public-api-WqUCiyIe.js +0 -131
- package/dist/packem_shared/readJsonSync-DweZd5ZA-0eZh9sGm.js +0 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +0 -1
- package/dist/packem_shared/resolve-explicit-BbT764KS.js +0 -5
- package/dist/packem_shared/resolve-runtime-D_vZovbB.js +0 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +0 -1
- package/dist/packem_shared/runtime-check-D4um-yQq.js +0 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +0 -1
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +0 -2
- package/dist/packem_shared/selectors-Ce_6UAoY.js +0 -3
- package/dist/packem_shared/signatures-Dyeyg1q9.js +0 -2
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
- package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
- package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
- package/dist/packem_shared/target-merge-Cfy7c__2.js +0 -11
- package/dist/packem_shared/target-options-7XcbqGDe.js +0 -1
- package/dist/packem_shared/toolchain-C_pNMBM6.js +0 -5
- package/dist/packem_shared/typosquats-xzcAGPiM.js +0 -1
- package/dist/packem_shared/use-measured-height-CBjN0fle.js +0 -1
- package/dist/packem_shared/utils-CRueU43T.js +0 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +0 -1
- package/dist/packem_shared/vis-update-app-DMAC2pPf.js +0 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +0 -30
- package/dist/packem_shared/watch-BXOOX7lx.js +0 -1
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +0 -11
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`;break;case 114:
|
|
3
|
-
`),l++,p=t,i=14;switch(c){case 123:return t++,i=1;case 125:return t++,i=2;case 91:return t++,i=3;case 93:return t++,i=4;case 58:return t++,i=6;case 44:return t++,i=5;case 34:return t++,r=T(),i=10;case 47:const g=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t<s&&!W(e.charCodeAt(t));)t++;return r=e.substring(g,t),i=12}if(e.charCodeAt(t+1)===42){t+=2;const b=s-1;let m=!1;for(;t<b;){const u=e.charCodeAt(t);if(u===42&&e.charCodeAt(t+1)===47){t+=2,m=!0;break}t++,W(u)&&(u===13&&e.charCodeAt(t)===10&&t++,l++,p=t)}return m||(t++,d=1),r=e.substring(g,t),i=13}return r+=String.fromCharCode(c),t++,i=16;case 45:if(r+=String.fromCharCode(c),t++,t===s||!L(e.charCodeAt(t)))return i=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=v(),i=11;default:for(;t<s&&N(c);)t++,c=e.charCodeAt(t);if(n!==t){switch(r=e.substring(n,t),r){case"true":return i=8;case"false":return i=9;case"null":return i=7}return i=16}return r+=String.fromCharCode(c),t++,i=16}}function N(c){if(ne(c)||W(c))return!1;switch(c){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function h(){let c;do c=A();while(c>=12&&c<=15);return c}return{setPosition:O,getPosition:()=>t,scan:o?h:A,getToken:()=>i,getTokenValue:()=>r,getTokenOffset:()=>n,getTokenLength:()=>t-n,getTokenStartLine:()=>a,getTokenStartCharacter:()=>n-f,getTokenError:()=>d}}function ne(e){return e===32||e===9}function W(e){return e===10||e===13}function L(e){return e>=48&&e<=57}var ve;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ve||(ve={}));new Array(20).fill(0).map((e,o)=>" ".repeat(o));const _=200;new Array(_).fill(0).map((e,o)=>`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>"\r"+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`\r
|
|
7
|
-
`+" ".repeat(o));var re;(function(e){e.DEFAULT={allowTrailingComma:!1}})(re||(re={}));function bt(e,o=[],s=re.DEFAULT){let t=null,r=[];const n=[];function i(l){Array.isArray(r)?r.push(l):t!==null&&(r[t]=l)}return yt(e,{onObjectBegin:()=>{const l={};i(l),n.push(r),r=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{r=n.pop()},onArrayBegin:()=>{const l=[];i(l),n.push(r),r=l,t=null},onArrayEnd:()=>{r=n.pop()},onLiteralValue:i,onError:(l,a,p)=>{o.push({error:l,offset:a,length:p})}},s),r[0]}function yt(e,o,s=re.DEFAULT){const t=Ot(e,!1),r=[];let n=0;function i(y){return y?()=>n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function l(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function p(y){return y?()=>{n>0?n++:y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(n=1)}:()=>!0}function f(y){return y?()=>{n>0&&n--,n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const d=p(o.onObjectBegin),k=a(o.onObjectProperty),O=f(o.onObjectEnd),v=p(o.onArrayBegin),T=f(o.onArrayEnd),A=a(o.onLiteralValue),N=l(o.onSeparator),h=i(o.onComment),c=l(o.onError),g=s&&s.disallowComments,b=s&&s.allowTrailingComma;function m(){for(;;){const y=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:g||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(y){case 12:case 13:g?u(10):h();break;case 16:u(1);break;case 15:case 14:break;default:return y}}}function u(y,C=[],ye=[]){if(c(y),C.length+ye.length>0){let Q=t.getToken();for(;Q!==17;){if(C.indexOf(Q)!==-1){m();break}else if(ye.indexOf(Q)!==-1)break;Q=m()}}}function E(y){const C=t.getTokenValue();return y?A(C):(k(C),r.push(C)),m(),!0}function B(){switch(t.getToken()){case 11:const y=t.getTokenValue();let C=Number(y);isNaN(C)&&(u(2),C=0),A(C);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}function H(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(N(":"),m(),ie()||u(4,[],[2,5])):u(5,[],[2,5]),r.pop(),!0)}function ze(){d(),m();let y=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(y||u(4,[],[]),N(","),m(),t.getToken()===2&&b)break}else y&&u(6,[],[]);H()||u(4,[],[2,5]),y=!0}return O(),t.getToken()!==2?u(7,[2],[]):m(),!0}function He(){v(),m();let y=!0,C=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(C||u(4,[],[]),N(","),m(),t.getToken()===4&&b)break}else C&&u(6,[],[]);y?(r.push(0),y=!1):r[r.length-1]++,ie()||u(4,[],[4,5]),C=!0}return T(),y||r.pop(),t.getToken()!==4?u(8,[4],[]):m(),!0}function ie(){switch(t.getToken()){case 3:return He();case 1:return ze();case 10:return E(!0);default:return B()}}return m(),t.getToken()===17?s.allowEmptyContent?!0:(u(4,[],[]),!1):ie()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ke;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ke||(ke={}));var Ce;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Ce||(Ce={}));const se=bt;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));function vt(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const kt=(e,o,s,t)=>{if(e.length===0)return;const r=e[0],n=ot(o,r.offset),i=new rt(`${vt(r.error)} at offset ${r.offset}`);throw i.fileName=s,i.codeFrame=st(o,{start:n},{tabWidth:!1,...t}),i},Ct=(e,o)=>{const{allowEmptyContent:s,allowTrailingComma:t=!0,beforeParse:r,buffer:n,color:i,compression:l,disallowComments:a,encoding:p="utf8",flag:f}=o??{},d=R(e,{buffer:n,compression:l,encoding:p,flag:f}),k=typeof r=="function"?r(d):d,O=[],v=se(k,O,{allowEmptyContent:s,allowTrailingComma:t,disallowComments:a});return kt(O,k,it(e),{color:i}),v};let wt;const Tt=e=>(wt??=D(import.meta.url))(e),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[o,s]=M.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return M.getBuiltinModule(e)}return Tt(e)};xt("node:fs/promises");let Et;const $t=e=>(Et??=D(import.meta.url))(e),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[o,s]=V.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return V.getBuiltinModule(e)}return $t(e)};St("node:fs");const At=(e,o)=>{const s=R(e,{encoding:"utf8",...o});return at(s)};var J={},Te;function It(){if(Te)return J;Te=1,Object.defineProperty(J,"__esModule",{value:!0});const e=h=>h!==null&&typeof h=="object",o=(h,c)=>Object.assign(new Error(`[${h}]: ${c}`),{code:h}),s="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",n="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,l=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var p=(h=>(h.Export="exports",h.Import="imports",h))(p||{});const f=(h,c,g,b,m)=>{if(c==null)return[];if(typeof c=="string"){const[u,...E]=c.split(a);if(u===".."||E.some(B=>l.test(B)))throw o(t,`Invalid "${h}" target "${c}" defined in the package config`);return[m?c.replace(/\*/g,m):c]}if(Array.isArray(c))return c.flatMap(u=>f(h,u,g,b,m));if(e(c)){for(const u of Object.keys(c)){if(i.test(u))throw o(s,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return f(h,c[u],g,b,m)}return[]}throw o(t,`Invalid "${h}" target "${c}"`)},d="*",k=(h,c)=>{const g=h.indexOf(d),b=c.indexOf(d);return g===b?c.length>h.length:b>g};function O(h,c){if(!c.includes(d)&&h.hasOwnProperty(c))return[c];let g,b;for(const m of Object.keys(h))if(m.includes(d)){const[u,E,B]=m.split(d);if(B===void 0&&c.startsWith(u)&&c.endsWith(E)){const H=c.slice(u.length,-E.length||void 0);H&&(!g||k(g,m))&&(g=m,b=H)}}return[g,b]}const v=h=>Object.keys(h).reduce((c,g)=>{const b=g===""||g[0]!==".";if(c===void 0||c===b)return b;throw o(s,'"exports" cannot contain some keys starting with "." and some not')},void 0),T=/^\w+:/,A=(h,c,g)=>{if(!h)throw new Error('"exports" is required');c=c===""?".":`./${c}`,(typeof h=="string"||Array.isArray(h)||e(h)&&v(h))&&(h={".":h});const[b,m]=O(h,c),u=f(p.Export,h[b],c,g,m);if(u.length===0)throw o(r,c==="."?'No "exports" main defined':`Package subpath '${c}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!T.test(E))throw o(t,`Invalid "exports" target "${E}" defined in the package config`);return u},N=(h,c,g)=>{if(!h)throw new Error('"imports" is required');const[b,m]=O(h,c),u=f(p.Import,h[b],c,g,m);if(u.length===0)throw o(n,`Package import specifier "${c}" is not defined in package`);return u};return J.resolveExports=A,J.resolveImports=N,J}var Nt=It();let Lt;const _t=e=>(Lt??=D(import.meta.url))(e),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,je=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[o,s]=q.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return q.getBuiltinModule(e)}return _t(e)},{statSync:X}=je("node:fs"),jt=je("node:module"),De=(e=process.cwd())=>{const{findPnpApi:o}=jt;return o?o(e):void 0},Dt=e=>se(R(e,{buffer:!1})),ce=(e,o,s,t)=>{const r=`resolveFromPackageJsonPath:${e}:${o}:${s?"yes":"no"}`;if(t?.has(r))return t.get(r);const n=Dt(e);if(!n)return;let i=o||"tsconfig.json";if(!s&&n.exports)try{const[l]=Nt.resolveExports(n.exports,o,["require","types"]);i=l}catch{return!1}else!o&&n.tsconfig&&(i=n.tsconfig);return i=w(e,"..",i),t?.set(r,i),i},le="package.json",ae="tsconfig.json",Rt=(e,o,s)=>{let t=e;if(e===".."&&(t=w(t,ae)),e.startsWith(".")&&(t=S(o,t)),be(t)){if($(t)){if(X(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if($(O))return O}return}const[r="",...n]=e.split("/"),i=r.startsWith("@")?`${r}/${String(n.shift())}`:r,l=n.join("/"),a=De(o);if(a){const{resolveRequest:O}=a;try{if(i===e){const v=O(w(i,le),o);if(v){const T=ce(v,l,!1,s);if(T&&$(T))return T}}else{let v;try{v=O(e,o,{extensions:[".json"]})}catch{v=O(w(e,ae),o)}if(v)return v}}catch{}}const p=te(O=>{const v=w(S(O),"node_modules",i);if($(v))return w("node_modules",i)},{cwd:o,type:"directory"});if(!p||!X(p).isDirectory())return;const f=w(p,le);if($(f)){const O=ce(f,l,!1,s);if(O===!1)return;if(O&&$(O)&&X(O).isFile())return O}const d=w(p,l),k=d.endsWith(".json");if(!k){const O=`${d}.json`;if($(O))return O}if($(d)){if(X(d).isDirectory()){const O=w(d,le);if($(O)){const T=ce(O,"",!0,s);if(T&&$(T))return T}const v=w(d,ae);if($(v))return v}else if(k)return d}},Re=e=>{const o=S(e);let s;const t=De(o);if(t)try{s=t.resolveRequest("typescript/package.json",o)??void 0}catch{}if(s??=te(r=>w(r,"node_modules","typescript","package.json"),{cwd:o,type:"file"}),!!s)try{const r=se(R(s,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},Be=new Set(["node16","node18","node20","nodenext"]),Fe=e=>e!==void 0&&Be.has(e),Bt=e=>{switch(e){case"node20":return"es2023";case"nodenext":return"esnext";default:return"es2022"}},Ft=e=>e==="nodenext"?"nodenext":"node16",Ut=e=>{if(e==="nodenext")return"nodenext";if(e==="node16")return"node16"},Ue=(e,o,s)=>{const t=o.has("module")?e.module:void 0,r=o.has("moduleResolution")?e.moduleResolution:void 0;let n;t!==void 0&&Be.has(t)?n=t:r!==void 0&&(n=Ut(r)),s.target!==void 0&&!o.has("target")&&(e.target=n?Bt(n):s.target),o.has("module")||(e.module=n??s.module),o.has("moduleResolution")||(e.moduleResolution=n?Ft(n):"bundler")},Pt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es3")},Wt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es5")},Mt=(e,o)=>{o.has("strict")||(e.strict=!0),Ue(e,o,{module:"es2022",target:"es2025"}),o.has("rootDir")||(e.rootDir="."),o.has("types")||(e.types=[]),o.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),o.has("libReplacement")||(e.libReplacement=!1),o.has("alwaysStrict")||(e.alwaysStrict=!0)},Vt=(e,o)=>{Ue(e,o,{module:"esnext"}),o.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},Jt=[[4,Pt],[5,Wt],[6,Mt],[7,Vt]],qt=/^v?(\d+)/,Kt=e=>{const o=qt.exec(e);return o?Number(o[1]):void 0},Gt=(e,o)=>{const s=Kt(o);if(s===void 0)return;const t=new Set(Object.keys(e));for(const[r,n]of Jt)r<=s&&n(e,t)},zt=e=>se(R(e,{buffer:!1})),Ht=e=>e.replaceAll("\\","/"),G=e=>{const o=nt(e);return ct(o)?o:`./${o}`},fe=["files","include","exclude"],xe=(e,o,s)=>{const t=w(o,s),r=z(e,t);return oe(r)||"./"},Qt=(e,o,s)=>{const t=z(e,o);if(!t)return s;const r=s.startsWith("./")?s.slice(2):s;return`${t}/${r}`},Yt=(e,o,s,t,r)=>{if(s.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);s.add(e);const n=I(e),i=Pe(e,t,s,r);delete i.references;const{compilerOptions:l}=i;if(l){const{baseUrl:a}=l;a&&!a.startsWith(x)&&(l.baseUrl=xe(o,n,a));const{outDir:p}=l;p&&!p.startsWith(x)&&(l.outDir=xe(o,n,p))}for(const a of fe){const p=i[a];p&&(i[a]=p.map(f=>f.startsWith(x)||be(f)?f:Qt(o,n,f)))}return i},Pe=(e,o,s=new Set,t=new Map)=>{let r;try{r=zt(e)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const n=I(e);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[We]=n)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const l=i.toReversed();for(let a=0;a<l.length;a++){const p=l[a],f=Rt(p,n,t);if(!f)throw new Le(`No such file or directory, for '${p}' found.`);const d=Yt(f,n,new Set(s),o,t);d.compilerOptions?.rootDir!==void 0&&!d.compilerOptions.rootDir.startsWith(x)&&(d.compilerOptions.rootDir=w(I(f),d.compilerOptions.rootDir));const k={...d,...r,compilerOptions:{...d.compilerOptions,...r.compilerOptions}};d.watchOptions&&(k.watchOptions={...d.watchOptions,...r.watchOptions}),r=k}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const l of["baseUrl","rootDir"]){const a=i[l];if(a&&!a.startsWith(x)){const p=S(n,a);i[l]=G(z(n,p))}}for(const l of["outDir","declarationDir"]){let a=i[l];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(p=>{const f=i[p];if(f)return f.startsWith(x)||be(f)?f:w(n,f)}).filter(Boolean)),a.startsWith(x)||(a=G(a)),i[l]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>Ht(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(x)?i:G(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(l=>oe(S(n,l)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(l=>oe(S(n,l)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},Z=(e,o)=>{if(e.startsWith(x))return oe(w(o,e.slice(x.length)))},Xt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Ee=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Zt=(e,o)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let s="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{s="node10";break}case"node16":case"node18":{s="node16";break}case"node20":{s="node16";break}case"nodenext":{s="nodenext";break}case"preserve":{s="bundler";break}}s!=="classic"&&(e.compilerOptions.moduleResolution=s)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.moduleResolution){let s=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(s=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&s&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&s&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let s="es5";switch(e.compilerOptions.module){case"node16":case"node18":{s="es2022";break}case"node20":{s="es2023";break}case"nodenext":{s="esnext";break}}s!=="es5"&&(e.compilerOptions.target=s)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(o?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const s=e.compilerOptions.module.toLocaleLowerCase();s==="node16"||s==="node18"||s==="node20"?e.compilerOptions.moduleResolution="node16":s==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const s=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(s!==void 0&&["node20","nodenext"].includes(s)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const s=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(s)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},eo=(e,o)=>{const s=e?.typescriptVersion;if(!(s===!1||s===void 0))return s==="auto"?Re(o):s},x="${configDir}",We=Symbol("implicitBaseUrl"),to=(e,o)=>{const s=S(e),t=Pe(s,o),r=I(s),n=eo(o,r);n&&t.compilerOptions&&Gt(t.compilerOptions,n);const{compilerOptions:i}=t;if(i){for(const a of Xt){const p=i[a];if(p){const f=Z(p,r);i[a]=f?G(z(r,f)):p}}for(const a of["rootDirs","typeRoots"]){const p=i[a];p&&(i[a]=p.map(f=>{const d=Z(f,r);return d?G(z(r,d)):f}))}const{paths:l}=i;if(l){const a=Object.keys(l);for(let p=0;p<a.length;p++){const f=a[p];l[f]=l[f].map(d=>Z(d,r)??d)}}}for(let l=0;l<fe.length;l++){const a=fe[l],p=t[a];p&&(t[a]=p.map(f=>Z(f,r)??f))}return Zt(t,o)};let oo;const ro=e=>(oo??=D(import.meta.url))(e),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[o,s]=K.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return K.getBuiltinModule(e)}return ro(e)},{statSync:io}=so("node:fs"),no=new Map,me=new WeakMap,co="tsconfig.json",Me=e=>{try{return io(e).mtimeMs}catch{return 0}},lo=(e,o)=>{let s=String(o.typescriptVersion);return o.typescriptVersion==="auto"&&(s=`auto:${String(Re(I(e)))}`),`${e}::${String(o.tscCompatible)}::${s}`},ao=(e,o,s)=>{if(e.has(o)&&me.get(e)?.get(o)===Me(s))return e.get(o)},po=(e,o,s,t)=>{e.set(o,t);let r=me.get(e);r||(r=new Map,me.set(e,r)),r.set(o,Me(s))},uo=(e,o={})=>{const s=o.configFileName??co,t=o.configFileName===void 0;let r=te(s,{...e&&{cwd:e},type:"file"});if(!r&&t&&(r=te("jsconfig.json",{...e&&{cwd:e},type:"file"})),!r)throw new Le(t?`No such file or directory, for '${s}' or 'jsconfig.json' found.`:`No such file or directory, for '${s}' found.`);const n=o.cache&&typeof o.cache!="boolean"?o.cache:no,i=lo(r,o);if(o.cache){const a=ao(n,i,r);if(a)return a}const l={config:to(r,{tscCompatible:o.tscCompatible,typescriptVersion:o.typescriptVersion}),path:r};return o.cache&&po(n,i,r,l),l},fo=/\.[cm]?tsx?$/,mo=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Ve=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,ho=e=>e.endsWith(".yaml")||e.endsWith(".yml")?lt(e):e.endsWith(".toml")?At(e):e.endsWith(".jsonc")?Ct(e,{allowTrailingComma:!0}):e.endsWith(".json5")?pt(e):Oe(e,"utf8"),he=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(o=>he(o)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([o,s])=>`${JSON.stringify(o)}:${he(s)}`).join(",")}}`:"null",pe=new Map,go=(e,o)=>e.startsWith(x)?w(o,e.slice(x.length)):e,Oo=e=>{if(pe.has(e))return pe.get(e);let o;try{const{config:s,path:t}=uo(e,{cache:!1}),r=I(t),n=s.compilerOptions,i=n?.paths??{};if(n!==void 0){const{baseUrl:l}=n;let a,p=!1;if(l===void 0){const f=n[We];a=typeof f=="string"?f:r}else p=!0,a=S(r,go(l,r));o={hasBaseUrl:p,paths:i,pathsBase:a}}}catch{o=void 0}return pe.set(e,o),o},Je=(e,o)=>{const s=Oo(o);if(s===void 0)return;const{hasBaseUrl:t,pathsBase:r}=s,n=i=>qe(i)??Ke(i);for(const[i,l]of Object.entries(s.paths)){const a=i.indexOf("*");if(a===-1){if(i===e)for(const d of l){const k=n(S(r,d));if(k!==void 0)return k}continue}const p=i.slice(0,a),f=i.slice(a+1);if(e.startsWith(p)&&e.endsWith(f)&&e.length>=p.length+f.length){const d=e.slice(p.length,e.length-f.length);for(const k of l){const O=k.replace("*",d),v=n(S(r,O));if(v!==void 0)return v}}}if(t){const i=n(S(r,e));if(i!==void 0)return i}};let $e=!1,ue=0,Se=!1,Ae=!1;const bo=()=>{Ae||(Ae=!0,process.setSourceMapsEnabled?.(!0))},yo=e=>{const o=e.indexOf("?");return o===-1?e:e.slice(0,o)},vo=e=>e.endsWith(".cts")?"commonjs":"module",Ie=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],j=e=>{try{return Ne(e).isFile()}catch{return!1}},ko=e=>{try{return Ne(e).isDirectory()}catch{return!1}},Co=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},qe=e=>{if(j(e))return e;const o=Co(e);if(o!==void 0&&j(o))return o;for(const s of Ie)if(j(e+s))return e+s;if(ko(e))for(const s of Ie){const t=`${e}/index${s}`;if(j(t))return t}},Ke=e=>{if(j(e)&&Ve.test(e))return e;for(const o of mo)if(j(e+o))return e+o},Ge=()=>{bo();const{registerHooks:e}=de;return typeof e!="function"?!1:($e||(e({load(o,s,t){const r=yo(o);if(r.startsWith("file:")&&fo.test(r)){const n=Y(r),{code:i}=_e(n,Oe(n,"utf8"));return{format:vo(n),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&Ve.test(r)){const n=Y(r),i=ho(n);return{format:"module",shortCircuit:!0,source:`export default ${he(i)};
|
|
8
|
-
`}}return t(o,s)},resolve(o,s,t){if((o.startsWith(".")||o.startsWith("/"))&&s.parentURL!==void 0){let r;try{r=new URL(o,s.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const n=Y(r),i=qe(n)??Ke(n);if(i!==void 0)return{shortCircuit:!0,url:ee(i).href}}}if(s.parentURL!==void 0&&!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("#")&&!o.startsWith("node:")&&!de.isBuiltin?.(o)){let r;try{r=I(Y(s.parentURL))}catch{r=void 0}if(r!==void 0){const n=Je(o,r);if(n!==void 0)return{shortCircuit:!0,url:ee(n).href}}}return t(o,s)}}),$e=!0),!0)},wo=()=>Ge(),To=async e=>{if(ue+=1,Ge())return await import(`${ee(e).href}?v=${String(ue)}`);Se||(Se=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
9
|
-
`));const{code:o}=_e(e,Oe(e,"utf8")),s=w(I(e),`.vis-ts-${String(ue)}-${String(process.pid)}.mjs`);Ze(s,o);try{return await import(ee(s).href)}finally{try{et(s)}catch{}}},Io=Object.defineProperty({__proto__:null,importTs:To,registerTsHooks:wo,resolveTsConfigPaths:Je},Symbol.toStringTag,{value:"Module"});export{To as i,At as m,wo as r,Io as t};
|
|
1
|
+
import{createRequire as Ge}from"node:module";import{z as F,g as Ye,d as Ze,r as Ke,T as Ce,C as et,U as j,m as _,a as P,k as X,e as h,h as $e,v as ae,G as Y,t as tt,L as nt,l as ot}from"../packem_shared/index-DHD8wb6Z.js";import{parse as it}from"./index6.js";import{y as $}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{transformTs as je}from"#native";let He;const ze=e=>(He??=Ge(import.meta.url))(e),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=e=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[n,i]=U.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return U.getBuiltinModule(e)}return ze(e)},{readFileSync:fe,writeFileSync:Qe,unlinkSync:Xe,statSync:Ie}=pe("node:fs"),re=pe("node:module"),{createRequire:Ee}=re,{pathToFileURL:Q,fileURLToPath:G}=pe("node:url");function st(e,n,i){const{beforeParse:t,buffer:o,compression:r,encoding:s="utf8",flag:p}={},c=F(e,{buffer:o,compression:r,encoding:s,flag:p}),f=typeof t=="function"?t(c):c;return Ye.parse(f,n)}function rt(e,n=!1){const i=e.length;let t=0,o="",r=0,s=16,p=0,c=0,f=0,a=0,m=0;function y(l,O){let b=0,g=0;for(;b<l;){let u=e.charCodeAt(t);if(u>=48&&u<=57)g=g*16+u-48;else if(u>=65&&u<=70)g=g*16+u-65+10;else if(u>=97&&u<=102)g=g*16+u-97+10;else break;t++,b++}return b<l&&(g=-1),g}function k(l){t=l,o="",r=0,s=16,m=0}function v(){let l=t;if(e.charCodeAt(t)===48)t++;else for(t++;t<e.length&&D(e.charCodeAt(t));)t++;if(t<e.length&&e.charCodeAt(t)===46)if(t++,t<e.length&&D(e.charCodeAt(t)))for(t++;t<e.length&&D(e.charCodeAt(t));)t++;else return m=3,e.substring(l,t);let O=t;if(t<e.length&&(e.charCodeAt(t)===69||e.charCodeAt(t)===101))if(t++,(t<e.length&&e.charCodeAt(t)===43||e.charCodeAt(t)===45)&&t++,t<e.length&&D(e.charCodeAt(t))){for(t++;t<e.length&&D(e.charCodeAt(t));)t++;O=t}else m=3;return e.substring(l,O)}function A(){let l="",O=t;for(;;){if(t>=i){l+=e.substring(O,t),m=2;break}const b=e.charCodeAt(t);if(b===34){l+=e.substring(O,t),t++;break}if(b===92){if(l+=e.substring(O,t),t++,t>=i){m=2;break}switch(e.charCodeAt(t++)){case 34:l+='"';break;case 92:l+="\\";break;case 47:l+="/";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
|
|
2
|
+
`;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:const u=y(4);u>=0?l+=String.fromCharCode(u):m=4;break;default:m=5}O=t;continue}if(b>=0&&b<=31)if(x(b)){l+=e.substring(O,t),m=2;break}else m=6;t++}return l}function N(){if(o="",m=0,r=t,c=p,a=f,t>=i)return r=i,s=17;let l=e.charCodeAt(t);if(ee(l)){do t++,o+=String.fromCharCode(l),l=e.charCodeAt(t);while(ee(l));return s=15}if(x(l))return t++,o+=String.fromCharCode(l),l===13&&e.charCodeAt(t)===10&&(t++,o+=`
|
|
3
|
+
`),p++,f=t,s=14;switch(l){case 123:return t++,s=1;case 125:return t++,s=2;case 91:return t++,s=3;case 93:return t++,s=4;case 58:return t++,s=6;case 44:return t++,s=5;case 34:return t++,o=A(),s=10;case 47:const O=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t<i&&!x(e.charCodeAt(t));)t++;return o=e.substring(O,t),s=12}if(e.charCodeAt(t+1)===42){t+=2;const b=i-1;let g=!1;for(;t<b;){const u=e.charCodeAt(t);if(u===42&&e.charCodeAt(t+1)===47){t+=2,g=!0;break}t++,x(u)&&(u===13&&e.charCodeAt(t)===10&&t++,p++,f=t)}return g||(t++,m=1),o=e.substring(O,t),s=13}return o+=String.fromCharCode(l),t++,s=16;case 45:if(o+=String.fromCharCode(l),t++,t===i||!D(e.charCodeAt(t)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=v(),s=11;default:for(;t<i&&L(l);)t++,l=e.charCodeAt(t);if(r!==t){switch(o=e.substring(r,t),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(l),t++,s=16}}function L(l){if(ee(l)||x(l))return!1;switch(l){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function d(){let l;do l=N();while(l>=12&&l<=15);return l}return{setPosition:k,getPosition:()=>t,scan:n?d:N,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>r,getTokenLength:()=>t-r,getTokenStartLine:()=>c,getTokenStartCharacter:()=>r-a,getTokenError:()=>m}}function ee(e){return e===32||e===9}function x(e){return e===10||e===13}function D(e){return e>=48&&e<=57}var de;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(de||(de={}));var Z;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Z||(Z={}));function lt(e,n=[],i=Z.DEFAULT){let t=null,o=[];const r=[];function s(c){Array.isArray(o)?o.push(c):t!==null&&(o[t]=c)}return ct(e,{onObjectBegin:()=>{const c={};s(c),r.push(o),o=c,t=null},onObjectProperty:c=>{t=c},onObjectEnd:()=>{o=r.pop()},onArrayBegin:()=>{const c=[];s(c),r.push(o),o=c,t=null},onArrayEnd:()=>{o=r.pop()},onLiteralValue:s,onError:(c,f,a)=>{n.push({error:c,offset:f,length:a})}},i),o[0]}function ct(e,n,i=Z.DEFAULT){const t=rt(e,!1),o=[];let r=0;function s(w){return w?()=>r===0&&w(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function p(w){return w?T=>r===0&&w(T,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function c(w){return w?T=>r===0&&w(T,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>o.slice()):()=>!0}function f(w){return w?()=>{r>0?r++:w(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>o.slice())===!1&&(r=1)}:()=>!0}function a(w){return w?()=>{r>0&&r--,r===0&&w(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const m=f(n.onObjectBegin),y=c(n.onObjectProperty),k=a(n.onObjectEnd),v=f(n.onArrayBegin),A=a(n.onArrayEnd),N=c(n.onLiteralValue),L=p(n.onSeparator),d=s(n.onComment),l=p(n.onError),O=i&&i.disallowComments,b=i&&i.allowTrailingComma;function g(){for(;;){const w=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:O||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(w){case 12:case 13:O?u(10):d();break;case 16:u(1);break;case 15:case 14:break;default:return w}}}function u(w,T=[],me=[]){if(l(w),T.length+me.length>0){let q=t.getToken();for(;q!==17;){if(T.indexOf(q)!==-1){g();break}else if(me.indexOf(q)!==-1)break;q=g()}}}function E(w){const T=t.getTokenValue();return w?N(T):(y(T),o.push(T)),g(),!0}function B(){switch(t.getToken()){case 11:const w=t.getTokenValue();let T=Number(w);isNaN(T)&&(u(2),T=0),N(T);break;case 7:N(null);break;case 8:N(!0);break;case 9:N(!1);break;default:return!1}return g(),!0}function J(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(L(":"),g(),C()||u(4,[],[2,5])):u(5,[],[2,5]),o.pop(),!0)}function Je(){m(),g();let w=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(w||u(4,[],[]),L(","),g(),t.getToken()===2&&b)break}else w&&u(6,[],[]);J()||u(4,[],[2,5]),w=!0}return k(),t.getToken()!==2?u(7,[2],[]):g(),!0}function qe(){v(),g();let w=!0,T=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(T||u(4,[],[]),L(","),g(),t.getToken()===4&&b)break}else T&&u(6,[],[]);w?(o.push(0),w=!1):o[o.length-1]++,C()||u(4,[],[4,5]),T=!0}return A(),w||o.pop(),t.getToken()!==4?u(8,[4],[]):g(),!0}function C(){switch(t.getToken()){case 3:return qe();case 1:return Je();case 10:return E(!0);default:return B()}}return g(),t.getToken()===17?i.allowEmptyContent?!0:(u(4,[],[]),!1):C()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ge;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ge||(ge={}));var Oe;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Oe||(Oe={}));const K=lt;var ke;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(ke||(ke={}));function ut(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const pt=(e,n,i,t)=>{if(e.length===0)return;const o=e[0],r=Ze(n,o.offset),s=new Ke(`${ut(o.error)} at offset ${o.offset}`);throw s.fileName=i,s.codeFrame=Ce(n,{start:r},{tabWidth:!1,...t}),s},ft=(e,n)=>{const{allowEmptyContent:i,allowTrailingComma:t=!0,beforeParse:o,buffer:r,color:s,compression:p,disallowComments:c,encoding:f="utf8",flag:a}=n??{},m=F(e,{buffer:r,compression:p,encoding:f,flag:a}),y=typeof o=="function"?o(m):m,k=[],v=K(y,k,{allowEmptyContent:i,allowTrailingComma:t,disallowComments:c});return pt(k,y,et(e),{color:s}),v},at=(e,n)=>{const i=F(e,{encoding:"utf8",...n});return it(i)};var S={},be;function mt(){if(be)return S;be=1,Object.defineProperty(S,"__esModule",{value:!0});const e=d=>d!==null&&typeof d=="object",n=(d,l)=>Object.assign(new Error(`[${d}]: ${l}`),{code:d}),i="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",o="ERR_PACKAGE_PATH_NOT_EXPORTED",r="ERR_PACKAGE_IMPORT_NOT_DEFINED",s=/^\d+$/,p=/^(\.{1,2}|node_modules)$/i,c=/\/|\\/;var f=(d=>(d.Export="exports",d.Import="imports",d))(f||{});const a=(d,l,O,b,g)=>{if(l==null)return[];if(typeof l=="string"){const[u,...E]=l.split(c);if(u===".."||E.some(B=>p.test(B)))throw n(t,`Invalid "${d}" target "${l}" defined in the package config`);return[g?l.replace(/\*/g,g):l]}if(Array.isArray(l))return l.flatMap(u=>a(d,u,O,b,g));if(e(l)){for(const u of Object.keys(l)){if(s.test(u))throw n(i,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return a(d,l[u],O,b,g)}return[]}throw n(t,`Invalid "${d}" target "${l}"`)},m="*",y=(d,l)=>{const O=d.indexOf(m),b=l.indexOf(m);return O===b?l.length>d.length:b>O};function k(d,l){if(!l.includes(m)&&d.hasOwnProperty(l))return[l];let O,b;for(const g of Object.keys(d))if(g.includes(m)){const[u,E,B]=g.split(m);if(B===void 0&&l.startsWith(u)&&l.endsWith(E)){const J=l.slice(u.length,-E.length||void 0);J&&(!O||y(O,g))&&(O=g,b=J)}}return[O,b]}const v=d=>Object.keys(d).reduce((l,O)=>{const b=O===""||O[0]!==".";if(l===void 0||l===b)return b;throw n(i,'"exports" cannot contain some keys starting with "." and some not')},void 0),A=/^\w+:/,N=(d,l,O)=>{if(!d)throw new Error('"exports" is required');l=l===""?".":`./${l}`,(typeof d=="string"||Array.isArray(d)||e(d)&&v(d))&&(d={".":d});const[b,g]=k(d,l),u=a(f.Export,d[b],l,O,g);if(u.length===0)throw n(o,l==="."?'No "exports" main defined':`Package subpath '${l}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!A.test(E))throw n(t,`Invalid "exports" target "${E}" defined in the package config`);return u},L=(d,l,O)=>{if(!d)throw new Error('"imports" is required');const[b,g]=k(d,l),u=a(f.Import,d[b],l,O,g);if(u.length===0)throw n(r,`Package import specifier "${l}" is not defined in package`);return u};return S.resolveExports=N,S.resolveImports=L,S}var dt=mt();let gt;const Ot=e=>(gt??=Ee(import.meta.url))(e),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[n,i]=W.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return W.getBuiltinModule(e)}return Ot(e)},{statSync:H}=Ne("node:fs"),kt=Ne("node:module"),_e=(e=process.cwd())=>{const{findPnpApi:n}=kt;return n?n(e):void 0},bt=e=>K(F(e,{buffer:!1})),te=(e,n,i,t)=>{const o=`resolveFromPackageJsonPath:${e}:${n}:${i?"yes":"no"}`;if(t?.has(o))return t.get(o);const r=bt(e);if(!r)return;let s=n||"tsconfig.json";if(!i&&r.exports)try{const[p]=dt.resolveExports(r.exports,n,["require","types"]);s=p}catch{return!1}else!n&&r.tsconfig&&(s=r.tsconfig);return s=h(e,"..",s),t?.set(o,s),s},ne="package.json",oe="tsconfig.json",wt=(e,n,i)=>{let t=e;if(e===".."&&(t=h(t,oe)),e.startsWith(".")&&(t=j(n,t)),ae(t)){if($(t)){if(H(t).isFile())return t}else if(!t.endsWith(".json")){const k=`${t}.json`;if($(k))return k}return}const[o="",...r]=e.split("/"),s=o.startsWith("@")?`${o}/${String(r.shift())}`:o,p=r.join("/"),c=_e(n);if(c){const{resolveRequest:k}=c;try{if(s===e){const v=k(h(s,ne),n);if(v){const A=te(v,p,!1,i);if(A&&$(A))return A}}else{let v;try{v=k(e,n,{extensions:[".json"]})}catch{v=k(h(e,oe),n)}if(v)return v}}catch{}}const f=X(k=>{const v=h(j(k),"node_modules",s);if($(v))return h("node_modules",s)},{cwd:n,type:"directory"});if(!f||!H(f).isDirectory())return;const a=h(f,ne);if($(a)){const k=te(a,p,!1,i);if(k===!1)return;if(k&&$(k)&&H(k).isFile())return k}const m=h(f,p),y=m.endsWith(".json");if(!y){const k=`${m}.json`;if($(k))return k}if($(m)){if(H(m).isDirectory()){const k=h(m,ne);if($(k)){const A=te(k,"",!0,i);if(A&&$(A))return A}const v=h(m,oe);if($(v))return v}else if(y)return m}},Le=e=>{const n=j(e);let i;const t=_e(n);if(t)try{i=t.resolveRequest("typescript/package.json",n)??void 0}catch{}if(i??=X(o=>h(o,"node_modules","typescript","package.json"),{cwd:n,type:"file"}),!!i)try{const o=K(F(i,{buffer:!1}));if(typeof o?.version=="string")return o.version}catch{}},De=new Set(["node16","node18","node20","nodenext"]),Re=e=>e!==void 0&&De.has(e),vt=e=>{switch(e){case"node20":return"es2023";case"nodenext":return"esnext";default:return"es2022"}},yt=e=>e==="nodenext"?"nodenext":"node16",Tt=e=>{if(e==="nodenext")return"nodenext";if(e==="node16")return"node16"},Fe=(e,n,i)=>{const t=n.has("module")?e.module:void 0,o=n.has("moduleResolution")?e.moduleResolution:void 0;let r;t!==void 0&&De.has(t)?r=t:o!==void 0&&(r=Tt(o)),i.target!==void 0&&!n.has("target")&&(e.target=r?vt(r):i.target),n.has("module")||(e.module=r??i.module),n.has("moduleResolution")||(e.moduleResolution=r?yt(r):"bundler")},ht=(e,n)=>{!n.has("target")&&!Re(e.module)&&(e.target="es3")},At=(e,n)=>{!n.has("target")&&!Re(e.module)&&(e.target="es5")},It=(e,n)=>{n.has("strict")||(e.strict=!0),Fe(e,n,{module:"es2022",target:"es2025"}),n.has("rootDir")||(e.rootDir="."),n.has("types")||(e.types=[]),n.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),n.has("libReplacement")||(e.libReplacement=!1),n.has("alwaysStrict")||(e.alwaysStrict=!0)},Et=(e,n)=>{Fe(e,n,{module:"esnext"}),n.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},$t=[[4,ht],[5,At],[6,It],[7,Et]],jt=/^v?(\d+)/,Nt=e=>{const n=jt.exec(e);return n?Number(n[1]):void 0},_t=(e,n)=>{const i=Nt(n);if(i===void 0)return;const t=new Set(Object.keys(e));for(const[o,r]of $t)o<=i&&r(e,t)},Lt=e=>K(F(e,{buffer:!1})),Dt=e=>e.replaceAll("\\","/"),M=e=>{const n=tt(e);return nt(n)?n:`./${n}`},le=["files","include","exclude"],we=(e,n,i)=>{const t=h(n,i),o=P(e,t);return Y(o)||"./"},Rt=(e,n,i)=>{const t=P(e,n);if(!t)return i;const o=i.startsWith("./")?i.slice(2):i;return`${t}/${o}`},Ft=(e,n,i,t,o)=>{if(i.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);i.add(e);const r=_(e),s=Be(e,t,i,o);delete s.references;const{compilerOptions:p}=s;if(p){const{baseUrl:c}=p;c&&!c.startsWith(I)&&(p.baseUrl=we(n,r,c));const{outDir:f}=p;f&&!f.startsWith(I)&&(p.outDir=we(n,r,f))}for(const c of le){const f=s[c];f&&(s[c]=f.map(a=>a.startsWith(I)||ae(a)?a:Rt(n,r,a)))}return s},Be=(e,n,i=new Set,t=new Map)=>{let o;try{o=Lt(e)??{}}catch(s){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:s})}if(typeof o!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const r=_(e);if(o.compilerOptions){const{compilerOptions:s}=o;s.paths&&!s.baseUrl&&(s[Ue]=r)}if(o.extends){const s=Array.isArray(o.extends)?o.extends:[o.extends];delete o.extends;const p=s.toReversed();for(let c=0;c<p.length;c++){const f=p[c],a=wt(f,r,t);if(!a)throw new $e(`No such file or directory, for '${f}' found.`);const m=Ft(a,r,new Set(i),n,t);m.compilerOptions?.rootDir!==void 0&&!m.compilerOptions.rootDir.startsWith(I)&&(m.compilerOptions.rootDir=h(_(a),m.compilerOptions.rootDir));const y={...m,...o,compilerOptions:{...m.compilerOptions,...o.compilerOptions}};m.watchOptions&&(y.watchOptions={...m.watchOptions,...o.watchOptions}),o=y}}if(o.compilerOptions){const{compilerOptions:s}=o;for(const p of["baseUrl","rootDir"]){const c=s[p];if(c&&!c.startsWith(I)){const f=j(r,c);s[p]=M(P(r,f))}}for(const p of["outDir","declarationDir"]){let c=s[p];c&&(Array.isArray(o.exclude)||(o.exclude=["outDir","declarationDir"].map(f=>{const a=s[f];if(a)return a.startsWith(I)||ae(a)?a:h(r,a)}).filter(Boolean)),c.startsWith(I)||(c=M(c)),s[p]=c)}}else o.compilerOptions={};if(o.include&&(o.include=o.include.map(s=>Dt(s))),o.files&&(o.files=o.files.map(s=>s.startsWith(I)?s:M(s))),o.watchOptions){const{watchOptions:s}=o;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(p=>Y(j(r,p)))),s.excludeFiles&&(s.excludeFiles=s.excludeFiles.map(p=>Y(j(r,p)))),s.watchFile&&(s.watchFile=s.watchFile.toLowerCase()),s.watchDirectory&&(s.watchDirectory=s.watchDirectory.toLowerCase()),s.fallbackPolling&&(s.fallbackPolling=s.fallbackPolling.toLowerCase())}if(o.compilerOptions.lib&&(o.compilerOptions.lib=o.compilerOptions.lib.map(s=>s.toLowerCase())),o.compilerOptions.module){let s=o.compilerOptions.module.toLowerCase();s==="es2015"&&(s="es6"),o.compilerOptions.module=s}if(o.compilerOptions.target){let s=o.compilerOptions.target.toLowerCase();s==="es2015"&&(s="es6"),o.compilerOptions.target=s}if(o.compilerOptions.moduleResolution){let s=o.compilerOptions.moduleResolution.toLowerCase();s==="node"&&(s="node10"),o.compilerOptions.moduleResolution=s}return o.compilerOptions.jsx&&(o.compilerOptions.jsx=o.compilerOptions.jsx.toLowerCase()),o.compilerOptions.moduleDetection&&(o.compilerOptions.moduleDetection=o.compilerOptions.moduleDetection.toLowerCase()),o.compilerOptions.importsNotUsedAsValues&&(o.compilerOptions.importsNotUsedAsValues=o.compilerOptions.importsNotUsedAsValues.toLowerCase()),o.compilerOptions.newLine&&(o.compilerOptions.newLine=o.compilerOptions.newLine.toLowerCase()),o},z=(e,n)=>{if(e.startsWith(I))return Y(h(n,e.slice(I.length)))},Bt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],ve=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Ut=(e,n)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(n?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let i="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{i="node10";break}case"node16":case"node18":{i="node16";break}case"node20":{i="node16";break}case"nodenext":{i="nodenext";break}case"preserve":{i="bundler";break}}i!=="classic"&&(e.compilerOptions.moduleResolution=i)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(n?.tscCompatible))&&e.compilerOptions.moduleResolution){let i=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(i=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&i&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&i&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let i="es5";switch(e.compilerOptions.module){case"node16":case"node18":{i="es2022";break}case"node20":{i="es2023";break}case"nodenext":{i="esnext";break}}i!=="es5"&&(e.compilerOptions.target=i)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&ve(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(n?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(n?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(n?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const i=e.compilerOptions.module.toLocaleLowerCase();i==="node16"||i==="node18"||i==="node20"?e.compilerOptions.moduleResolution="node16":i==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!ve(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const i=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(i!==void 0&&["node20","nodenext"].includes(i)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const i=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(i)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},xt=(e,n)=>{const i=e?.typescriptVersion;if(!(i===!1||i===void 0))return i==="auto"?Le(n):i},I="${configDir}",Ue=Symbol("implicitBaseUrl"),St=(e,n)=>{const i=j(e),t=Be(i,n),o=_(i),r=xt(n,o);r&&t.compilerOptions&&_t(t.compilerOptions,r);const{compilerOptions:s}=t;if(s){for(const c of Bt){const f=s[c];if(f){const a=z(f,o);s[c]=a?M(P(o,a)):f}}for(const c of["rootDirs","typeRoots"]){const f=s[c];f&&(s[c]=f.map(a=>{const m=z(a,o);return m?M(P(o,m)):a}))}const{paths:p}=s;if(p){const c=Object.keys(p);for(let f=0;f<c.length;f++){const a=c[f];p[a]=p[a].map(m=>z(m,o)??m)}}}for(let p=0;p<le.length;p++){const c=le[p],f=t[c];f&&(t[c]=f.map(a=>z(a,o)??a))}return Ut(t,n)};let Wt;const Vt=e=>(Wt??=Ee(import.meta.url))(e),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mt=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[n,i]=V.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return V.getBuiltinModule(e)}return Vt(e)},{statSync:Pt}=Mt("node:fs"),Jt=new Map,ce=new WeakMap,qt="tsconfig.json",xe=e=>{try{return Pt(e).mtimeMs}catch{return 0}},Gt=(e,n)=>{let i=String(n.typescriptVersion);return n.typescriptVersion==="auto"&&(i=`auto:${String(Le(_(e)))}`),`${e}::${String(n.tscCompatible)}::${i}`},Ht=(e,n,i)=>{if(e.has(n)&&ce.get(e)?.get(n)===xe(i))return e.get(n)},zt=(e,n,i,t)=>{e.set(n,t);let o=ce.get(e);o||(o=new Map,ce.set(e,o)),o.set(n,xe(i))},Qt=(e,n={})=>{const i=n.configFileName??qt,t=n.configFileName===void 0;let o=X(i,{...e&&{cwd:e},type:"file"});if(!o&&t&&(o=X("jsconfig.json",{...e&&{cwd:e},type:"file"})),!o)throw new $e(t?`No such file or directory, for '${i}' or 'jsconfig.json' found.`:`No such file or directory, for '${i}' found.`);const r=n.cache&&typeof n.cache!="boolean"?n.cache:Jt,s=Gt(o,n);if(n.cache){const c=Ht(r,s,o);if(c)return c}const p={config:St(o,{tscCompatible:n.tscCompatible,typescriptVersion:n.typescriptVersion}),path:o};return n.cache&&zt(r,s,o,p),p},Xt=/\.[cm]?tsx?$/,Yt=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Se=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,Zt=e=>e.endsWith(".yaml")||e.endsWith(".yml")?ot(e):e.endsWith(".toml")?at(e):e.endsWith(".jsonc")?ft(e,{allowTrailingComma:!0}):e.endsWith(".json5")?st(e):fe(e,"utf8"),ue=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(n=>ue(n)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([i,t])=>`${JSON.stringify(i)}:${ue(t)}`).join(",")}}`:"null",ie=new Map,Kt=(e,n)=>e.startsWith(I)?h(n,e.slice(I.length)):e,Ct=e=>{if(ie.has(e))return ie.get(e);let n;try{const{config:i,path:t}=Qt(e,{cache:!1}),o=_(t),r=i.compilerOptions,s=r?.paths??{};if(r!==void 0){const{baseUrl:p}=r;let c,f=!1;if(p===void 0){const a=r[Ue];c=typeof a=="string"?a:o}else f=!0,c=j(o,Kt(p,o));n={hasBaseUrl:f,paths:s,pathsBase:c}}}catch{n=void 0}return ie.set(e,n),n},We=(e,n)=>{const i=Ct(n);if(i===void 0)return;const{hasBaseUrl:t,pathsBase:o}=i,r=s=>Ve(s)??Me(s);for(const[s,p]of Object.entries(i.paths)){const c=s.indexOf("*");if(c===-1){if(s===e)for(const m of p){const y=r(j(o,m));if(y!==void 0)return y}continue}const f=s.slice(0,c),a=s.slice(c+1);if(e.startsWith(f)&&e.endsWith(a)&&e.length>=f.length+a.length){const m=e.slice(f.length,e.length-a.length);for(const y of p){const k=y.replace("*",m),v=r(j(o,k));if(v!==void 0)return v}}}if(t){const s=r(j(o,e));if(s!==void 0)return s}};let ye=!1,se=0,Te=!1,he=!1;const en=()=>{he||(he=!0,process.setSourceMapsEnabled?.(!0))},tn=e=>{const n=e.indexOf("?");return n===-1?e:e.slice(0,n)},nn=e=>e.endsWith(".cts")?"commonjs":"module",Ae=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],R=e=>{try{return Ie(e).isFile()}catch{return!1}},on=e=>{try{return Ie(e).isDirectory()}catch{return!1}},sn=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},Ve=e=>{if(R(e))return e;const n=sn(e);if(n!==void 0&&R(n))return n;for(const i of Ae)if(R(e+i))return e+i;if(on(e))for(const i of Ae){const t=`${e}/index${i}`;if(R(t))return t}},Me=e=>{if(R(e)&&Se.test(e))return e;for(const n of Yt)if(R(e+n))return e+n},Pe=()=>{en();const{registerHooks:e}=re;return typeof e!="function"?!1:(ye||(e({load(n,i,t){const o=tn(n);if(o.startsWith("file:")&&Xt.test(o)){const r=G(o),{code:s}=je(r,fe(r,"utf8"));return{format:nn(r),shortCircuit:!0,source:s}}if(o.startsWith("file:")&&Se.test(o)){const r=G(o),s=Zt(r);return{format:"module",shortCircuit:!0,source:`export default ${ue(s)};
|
|
4
|
+
`}}return t(n,i)},resolve(n,i,t){if((n.startsWith(".")||n.startsWith("/"))&&i.parentURL!==void 0){let o;try{o=new URL(n,i.parentURL)}catch{o=void 0}if(o?.protocol==="file:"){const r=G(o),s=Ve(r)??Me(r);if(s!==void 0)return{shortCircuit:!0,url:Q(s).href}}}if(i.parentURL!==void 0&&!n.startsWith(".")&&!n.startsWith("/")&&!n.startsWith("#")&&!n.startsWith("node:")&&!re.isBuiltin?.(n)){let o;try{o=_(G(i.parentURL))}catch{o=void 0}if(o!==void 0){const r=We(n,o);if(r!==void 0)return{shortCircuit:!0,url:Q(r).href}}}return t(n,i)}}),ye=!0),!0)},rn=()=>Pe(),ln=async e=>{if(se+=1,Pe())return await import(`${Q(e).href}?v=${String(se)}`);Te||(Te=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
5
|
+
`));const{code:n}=je(e,fe(e,"utf8")),i=h(_(e),`.vis-ts-${String(se)}-${String(process.pid)}.mjs`);Qe(i,n);try{return await import(Q(i).href)}finally{try{Xe(i)}catch{}}},mn=Object.defineProperty({__proto__:null,importTs:ln,registerTsHooks:rn,resolveTsConfigPaths:We},Symbol.toStringTag,{value:"Module"});export{ln as i,at as m,rn as r,mn as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p}from"./cli-main.js";import{
|
|
2
|
-
`),n.status==="fail"&&(process.exitCode=1);return}const[
|
|
1
|
+
import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-de-jCq8q.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-DBH2Qo4I.js";import{z as S,e as g}from"../packem_shared/index-DHD8wb6Z.js";import{S as $}from"../packem_shared/lockfile-DhHAaHN5.js";import{e as x}from"../packem_shared/index-DXPSWMbG.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";const E=e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},M=(e,o)=>{for(const i of o)if(i===e||i.endsWith("*")&&e.startsWith(i.slice(0,-1)))return!0;return!1},L=(e,o,i={})=>{const t=m(e,o);if(!t)return[];let s;try{s=S(g(e,t.file))}catch{return[]}const n=$(s,t.type);if(n.length===0)return[];const r=i.allow??[],l=[],f=new Set;for(const c of n){const a=`${c.name}@${c.version}`;for(const d of[c.dependencies,c.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!M(u,r))for(const k of h){if(!E(k))continue;const y=`${a}->${u}@${k}`;f.has(y)||(f.add(y),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((c,a)=>c.packageName.localeCompare(a.packageName)||c.declaredBy.localeCompare(a.declaredBy))},D=new Set(["firstSeen","publisherChange"]),I=e=>e.severity==="block"&&e.acceptedRisk===void 0,N=e=>{const o=e.security?.policies?.firstSeen?.minutes,i=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",s=e.security?.blockExoticSubdeps===!0;return i||t||s},O=async e=>{const{offline:o=!1,packageManager:i,visConfig:t,workspaceRoot:s}=e,n=Date.now();if(!N(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const r=m(s,i);if(!r||!C(g(s,r.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(s,i,{includeDev:!0}),f=l.length,c=await x({offline:o,packageManager:i,packages:l,workspaceRoot:s},"install",{enabledPolicies:new Set(D),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?L(s,i,{allow:t.security.exoticSubdepsAllow}):[],d=c.some(u=>I(u))||a.length>0;return{decisions:c,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},P=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,V=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${P(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const i=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&i.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)i.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return i},z=async({options:e,visConfig:o,workspaceRoot:i})=>{const t=i??process.cwd(),s=b(t);if(!v[s.name]){p.warn(`Package manager '${s.name}' has no lockfile vis can verify.`);return}const n=await O({offline:!!e.offline,packageManager:s.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
|
+
`),n.status==="fail"&&(process.exitCode=1);return}const[r,...l]=V(n);if(n.status==="skipped"){p.info(r);return}if(n.status==="pass"){p.success(r);return}p.error(r);for(const f of l)p.error(f);process.exitCode=1};export{z as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`).map(
|
|
1
|
+
import{a as h}from"../packem_shared/index-B4AjSxHU.js";import{b}from"./index2.js";import{r as R}from"./orchestrator.js";const w=e=>{let o=0;const a=[],r=()=>{if(o>=e)return;const n=a.shift();n&&(o+=1,n())};return async n=>new Promise((m,s)=>{const d=()=>{o-=1,r()},f=()=>{n().then(m,s).finally(d)};a.push(f),r()})},k=4,g=new Map,y=(e,o)=>{const a=d=>d.replaceAll(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`);let r="^",n=0;const m=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g;let s;for(;(s=m.exec(e))!==null;){switch(r+=a(e.slice(n,s.index)),s[1]){case"name":{r+=a(o.name);break}case"unscopedName":{r+=a(o.name.replace(/^@[^/]+\//,""));break}case"version":{r+=String.raw`(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)`;break}default:r+="[^/]+"}n=s.index+s[0].length}return r+=`${a(e.slice(n))}$`,new RegExp(r)},p=async(e,o,a,r)=>{if(o==="disk")return{resolvedFrom:"disk",version:e.version};if(o==="registry"){const c=R(e,r.perPackageConfig??{}),l=await b(c).readPublishedVersion({pkg:e,pm:r.pm,workspaceConfig:r.workspaceConfig});return l&&h.valid(l)?{resolvedFrom:"registry",version:l}:{fallbackReason:l===void 0?`registry returned no version for ${e.name} (likely a 404 / not-yet-published); falling back to manifest version ${e.version}.`:`registry returned an invalid semver "${l}" for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}}const n=r.perPackageConfig?.releaseTagPattern??r.workspaceConfig?.releaseTagPattern??"{name}@{version}",m=n.replaceAll(/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,(c,i)=>i==="name"?e.name:i==="unscopedName"?e.name.replace(/^@[^/]+\//,""):"*"),s=await r.runner.run("git",["tag","--list",m,"--sort=-v:refname"],{cwd:r.cwd,silent:!0});if(s.exitCode!==0)return{fallbackReason:`git tag --list ${m} failed (exit ${s.exitCode}); falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version};const d=s.stdout.split(`
|
|
2
|
+
`).map(c=>c.trim()).filter(Boolean);if(d.length===0)return{fallbackReason:`no git tag matched pattern "${n}" for ${e.name}; falling back to manifest version ${e.version}. (Pass --first-release to bootstrap.)`,resolvedFrom:"disk",version:e.version};const f=y(n,e),t=[];for(const c of d){const i=f.exec(c);i?.[1]&&h.valid(i[1])&&t.push(i[1])}return t.length===0?{fallbackReason:`git tag pattern "${n}" matched tags but none yielded a valid semver for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}:(t.sort(h.rcompare),{resolvedFrom:"git-tag",version:t[0]})},x=(e,o,a)=>a?"disk":o?.currentVersionResolver??e?.currentVersionResolver??"disk",V=async(e,o,a,r,n)=>{const m=new Map,s=[],d=w(k),f=await Promise.all(e.map(async t=>d(async()=>{const c=r.get(t.name),i=x(a,c,n.firstRelease),l=n.skipRegistryLookup?"disk":i,u=`${t.name}@${l}@${t.version}`,$=g.get(u);if($)return{mode:l,pkg:t,result:await $};const v=p(t,l,o,{...n,perPackageConfig:c,workspaceConfig:a});return g.set(u,v),v.catch(()=>{g.get(u)===v&&g.delete(u)}),{mode:l,pkg:t,result:await v}})));for(const{mode:t,pkg:c,result:i}of f)m.set(c.name,i.version),i.fallbackReason&&t!=="disk"&&s.push(`currentVersionResolver (${t}): ${i.fallbackReason}`);return{versions:m,warnings:s}};export{k as REGISTRY_LOOKUP_CONCURRENCY,y as compileReleaseTagRegex,p as resolveCurrentVersion,V as resolveCurrentVersionsForWorkspace,x as resolveModeForPackage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{redactTokens as
|
|
1
|
+
import{redactTokens as h}from"./security.js";import{expandNotificationTemplate as d}from"./interface.js";const c=(o,e)=>{if(typeof o=="string")return d(o,e);if(Array.isArray(o))return o.map(r=>c(r,e));if(o!==null&&typeof o=="object"){const r={};for(const[n,i]of Object.entries(o))r[n]=c(i,e);return r}return o},f=o=>({channel:o.channel,completedAt:o.completedAt,monorepoName:o.monorepoName,published:o.published.map(e=>({name:e.name,tag:e.tag,url:e.url,version:e.version})),repo:o.repo,skipped:o.skipped.map(e=>({name:e.name}))}),p=(o,e)=>{if(!o)return{};const r={};for(const[n,i]of Object.entries(o))r[n]=d(i,e);return r};class b{constructor(e){this.config=e,this.id=e.id?`webhook:${e.id}`:"webhook"}config;id;async send(e){const r=this.config.method??"POST",n={"Content-Type":"application/json",...p(this.config.headers,e)},i=this.config.body===void 0?f(e):c(this.config.body,e);let s;try{s=await fetch(this.config.url,{body:JSON.stringify(i),headers:n,method:r})}catch(t){const a=t instanceof Error?t.name:"NetworkError";throw new Error(`Webhook ${this.id} fetch failed (${a})`,{cause:t})}if(!s.ok){const t=await s.text().catch(()=>""),a=t?`: ${h(t.slice(0,200))}`:"";throw new Error(`Webhook ${this.id} POST <webhook-url> returned ${s.status} ${s.statusText}${a}`)}}}export{b as WebhookNotificationChannel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t=e=>{switch(e){case"bun":return"bun install --frozen-lockfile";case"npm":return"npm ci";case"pnpm":return"pnpm install --frozen-lockfile";case"yarn":return"yarn install --immutable";default:return`${e} install`}},r=e=>`${e} run build`,n=e=>e==="npm"?"npx":e==="bun"?"bunx":`${e} exec`,
|
|
1
|
+
const t=e=>{switch(e){case"bun":return"bun install --frozen-lockfile";case"npm":return"npm ci";case"pnpm":return"pnpm install --frozen-lockfile";case"yarn":return"yarn install --immutable";default:return`${e} install`}},r=e=>`${e} run build`,n=e=>e==="npm"?"npx":e==="bun"?"bunx":`${e} exec`,u=e=>{switch(e){case"bun":return"npm install -g bun";case"npm":return"";case"pnpm":return"npm install -g pnpm";case"yarn":return"corepack enable && corepack prepare yarn@stable --activate";default:return""}},o=e=>`# vis release — primary release workflow.
|
|
2
2
|
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
3
3
|
|
|
4
4
|
name: vis release
|
|
@@ -47,7 +47,7 @@ ${e.useOidc?` # OIDC trusted publishing — no publish token ne
|
|
|
47
47
|
GIT_AUTHOR_EMAIL: "vis-release-bot@users.noreply.github.com"
|
|
48
48
|
GIT_COMMITTER_NAME: "vis-release-bot"
|
|
49
49
|
GIT_COMMITTER_EMAIL: "vis-release-bot@users.noreply.github.com"
|
|
50
|
-
`,
|
|
50
|
+
`,h=e=>`# vis release ci check — sticky PR comment with release plan.
|
|
51
51
|
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
52
52
|
|
|
53
53
|
name: vis release check
|
|
@@ -77,7 +77,7 @@ ${e.packageManager==="pnpm"?` - uses: pnpm/action-setup@v4
|
|
|
77
77
|
- run: ${n(e.packageManager)} vis release ci check
|
|
78
78
|
env:
|
|
79
79
|
GH_TOKEN: \${{ github.token }}
|
|
80
|
-
`,
|
|
80
|
+
`,g=e=>`# vis release ci snapshot — preview release publish + sticky PR comment.
|
|
81
81
|
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
82
82
|
|
|
83
83
|
name: vis release snapshot
|
|
@@ -134,7 +134,7 @@ variables:
|
|
|
134
134
|
PM: "${e.packageManager}"
|
|
135
135
|
|
|
136
136
|
before_script:
|
|
137
|
-
${
|
|
137
|
+
${u(e.packageManager)?` - ${u(e.packageManager)}
|
|
138
138
|
`:""} - ${t(e.packageManager)}
|
|
139
139
|
|
|
140
140
|
${e.includeCheck?`vis-release-check:
|
|
@@ -164,4 +164,4 @@ ${e.branches.map(s=>` - if: $CI_COMMIT_BRANCH == "${s}"`).join(`
|
|
|
164
164
|
script:
|
|
165
165
|
- ${r(e.packageManager)}
|
|
166
166
|
- ${n(e.packageManager)} vis release ci release
|
|
167
|
-
`,k=(e,s={})=>{const
|
|
167
|
+
`,k=(e,s={})=>{const l=s.provider??(e.provider==="github"||e.provider==="gitlab"?e.provider:"github"),p=e.channels??{},c=s.branches??Object.keys(p);c.length===0&&c.push("main");const a={branches:c,includeCheck:s.includeCheck??!0,includeSnapshot:s.includeSnapshot??!0,packageManager:s.packageManager??"pnpm",useOidc:s.useOidc??!0};if(l==="gitlab")return[{content:b(a),path:".gitlab-ci.yml"}];const i=[{content:o(a),path:".github/workflows/vis-release.yml"}];return a.includeCheck&&i.push({content:h(a),path:".github/workflows/vis-release-check.yml"}),a.includeSnapshot&&i.push({content:g(a),path:".github/workflows/vis-release-snapshot.yml"}),i};export{k as generateWorkflowFiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`)},
|
|
1
|
+
import{createRequire as d}from"node:module";import v from"./index.js";import{normaliseGroup as C}from"../release/types.js";import{d as b}from"./index2.js";import{resolveFormatter as G}from"./resolveFormatter.js";let m;const f=e=>(m??=d(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[n,o]=g.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return g.getBuiltinModule(e)}return f(e)},{readFile:w,writeFile:_}=u("node:fs/promises"),j="## Release wave {date} ({count} packages)",k=async(e,n,o,s={})=>{const i=s.renderer??o,t=[(s.waveHeading??j).replaceAll("{date}",n).replaceAll("{count}",String(e.length)),""];for(const a of e){t.push(`### ${a.name} → ${a.newVersion}`),t.push("");const c={changeFiles:a.changeFiles,date:n,release:a,target:"github-release"},l=await i(c);l.trim()?t.push(l.trim()):t.push("_No changelog entries._"),t.push("")}return t.join(`
|
|
2
|
+
`)},A=(e,n={})=>{const o=n.file??"CHANGELOG.md";return o.startsWith("/")?o:`${e}/${o}`},R=/[!()*+?@[\]{|}]/,y=(e,n)=>{const o=[],s=new Set;for(const i of e)if(R.test(i))for(const r of n)!s.has(r.name)&&v(i,r.name)&&(s.add(r.name),o.push(r));else{const r=n.find(t=>t.name===i);r&&!s.has(r.name)&&(s.add(r.name),o.push(r))}return o},N=(e,n,o)=>{const s=new Map,i=[...e.fixed??[],...e.linked??[]];for(const r of i){const t=C(r);if(t.changelog.mode!=="shared")continue;const a=y(t.packages,n);if(a.length===0)continue;let c;t.changelog.path?c=t.changelog.path.startsWith("/")?t.changelog.path:`${o}/${t.changelog.path}`:c=`${[...a].sort((h,p)=>h.name.localeCompare(p.name))[0].dir}/GROUP-CHANGELOG.md`;for(const l of a)s.has(l.name)||s.set(l.name,c)}return s},O=async(e,n)=>{if(n.length===0)return;const o=e.workspaceChangelog,s=typeof o=="object"?o:void 0,i=await G(e.changelogConfig,e.cwd),r=new Date().toISOString().slice(0,10),t=await k(n,r,i,s),a=A(e.cwd,s),c=await w(a,"utf8").catch(()=>{});return await _(a,b(t,c)),a};export{k as renderWorkspaceChangelog,N as resolveGroupChangelogRouting,A as workspaceChangelogPath,O as writeWorkspaceChangelogWave};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as i,a as d,p}from"../packem_chunks/orchestrator.js";const y=async(t={})=>{const e=await i(t),a=await d(e,{dryRun:t.dryRun});return{changedFiles:a.changedFiles,deletedFiles:a.deletedFiles,plan:a.plan}},w=async(t={})=>{const e=await i(t),{resolveFormatter:a}=await import("../packem_chunks/resolveFormatter.js"),n=await a(e.config.changelog,e.cwd),r=new Date().toISOString().slice(0,10),s=[];for(const c of e.plan.releases){const l=e.depGraph.getPackage(c.name);if(!l)continue;const o=await n({changeFiles:c.changeFiles,date:r,release:c,target:"changelog"});s.push({content:o,file:`${l.dir}/CHANGELOG.md`,package:c.name})}return{projectChangelogs:s}},F=async(t={})=>{const e=await i(t);return await p(e,{dryRun:t.dryRun,otp:t.otp,tag:t.tag})},m=async(t={})=>{const e=await i(t);let a=!1,n;const r=async()=>{if(n)return n;a=!0;const s=await d(e,{dryRun:t.dryRun});return n={changedFiles:s.changedFiles,deletedFiles:s.deletedFiles,plan:s.plan},n};return{apply:r,discard:()=>{a=!0},plan:e.plan,[Symbol.asyncDispose]:async()=>{a||await r()}}},R=async t=>{const e=await i(t),{runSnapshot:a}=await import("../packem_chunks/snapshot.js"),n=await a({context:e,dryRun:t.dryRun,registry:t.registry,tag:t.tag});return{failed:n.failed,published:n.published,skipped:n.skipped,snapshotVersion:n.snapshotVersion,tag:n.tag}},x=async(t={})=>{const e=await i(t),a=await d(e,{dryRun:t.dryRun}),n={changedFiles:a.changedFiles,deletedFiles:a.deletedFiles,plan:a.plan},{resolveFormatter:r}=await import("../packem_chunks/resolveFormatter.js"),s=await r(e.config.changelog,e.cwd),c=new Date().toISOString().slice(0,10),l=[];for(const g of a.plan.releases){const u=e.depGraph.getPackage(g.name);if(!u)continue;const f=await s({changeFiles:g.changeFiles,date:c,release:g,target:"changelog"});l.push({content:f,file:`${u.dir}/CHANGELOG.md`,package:g.name})}const o={projectChangelogs:l};if(t.skipPublish)return{changelog:o,publish:{failed:[],published:[],skipped:[]},version:n};const h=await p(e,{dryRun:t.dryRun,otp:void 0,tag:void 0});return{changelog:o,publish:h,version:n}};class k{constructor(e={}){this.config=e}config;releaseVersion(e={}){return y({...e,config:this.config})}releaseChangelog(e={}){return w({...e,config:this.config})}releasePublish(e={}){return F({...e,config:this.config})}releaseDraft(e={}){return m({...e,config:this.config})}releaseSnapshot(e){return R({...e,config:this.config})}}export{k as ReleaseClient,x as release,w as releaseChangelog,m as releaseDraft,F as releasePublish,R as releaseSnapshot,y as releaseVersion};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{createRequire as Zt}from"node:module";let Qt;const Xt=t=>(Qt??=Zt(import.meta.url))(t),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ti=t=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[i,e]=D.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return D.getBuiltinModule(t)}return Xt(t)},{createRequire:ii}=ti("node:module");let ei;const oi=t=>(ei??=ii(import.meta.url))(t),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:J,pt=t=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[i,e]=P.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return P.getBuiltinModule(t)}return oi(t)},J=P,{execFileSync:ri}=pt("node:child_process"),Y=pt("node:fs"),ni=pt("node:tty"),si=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],hi=12288,ai=65510,ci=[12288,12288,65281,65376,65504,65510],li=8361,di=65518,ui=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],fi=32,mi=10630,wi=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],pi=4352,gi=262141,Tt=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],U=(t,i)=>{let e=0,o=Math.floor(t.length/2)-1;for(;e<=o;){const h=Math.floor((e+o)/2),s=h*2;if(i<t[s])o=h-1;else if(i>t[s+1])e=h+1;else return!0}return!1},bt=19968,[bi,xi]=yi(Tt);function yi(t){let i=t[0],e=t[1];for(let o=0;o<t.length;o+=2){const h=t[o],s=t[o+1];if(bt>=h&&bt<=s)return[h,s];s-h>e-i&&(i=h,e=s)}return[i,e]}const Wi=t=>t<161||t>1114109?!1:U(si,t),Bi=t=>t<hi||t>ai?!1:U(ci,t),vi=t=>t<li||t>di?!1:U(ui,t),Ri=t=>t<fi||t>mi?!1:U(wi,t),Si=t=>t>=bi&&t<=xi?!0:t<pi||t>gi?!1:U(Tt,t);function Ai(t){return Wi(t)?"ambiguous":Bi(t)?"fullwidth":vi(t)?"halfwidth":Ri(t)?"narrow":Si(t)?"wide":"neutral"}function Ci(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Ot(t){return Ci(t),Ai(t)}const _t=String.raw,xt=_t`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Ii=()=>new RegExp(_t`\p{RI}{2}|(?)${xt}(?:\u200D${xt})*`,"gu"),q=new Set(["\x1B",""]),lt="\x07",$t="[",gt="m",K="]8;;",Mi=39,Ei=/[\u200B\uFEFF\u2060-\u2064]/g,ki=new RegExp(`(?:\\${$t}(?<code>\\d+)m|\\${K}(?<uri>.*)${lt})`),ji=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),ht=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,yt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,Wt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,Z=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ni=Ii(),Bt=new Map,Li=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Fi=t=>{const i=Li(t.width);let e=Bt.get(i);return e||(e=new Map,Bt.set(i,e)),e},Q=new RegExp(ht.source,"y"),dt=new RegExp(Ni.source,"uy"),X=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ht=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",Ji=(t,i)=>{const e=Fi(i),o=Math.floor(t/65536),h=t%65536;let s=e.get(o);if(s||(s=new Map,e.set(o,s)),s.has(h))return s.get(h);let r;switch(Ht(t)){case"control":{r=i.width.control;break}case"latin":{r=i.width.regular;break}case"wide":{r=i.width.wide;break}case"zero":{r=0;break}default:switch(Ot(t)){case"ambiguous":{r=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{r=i.width.fullWidth;break}case"wide":{r=i.width.wide;break}default:r=i.width.regular}}return s.set(h,r),r},Ti=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,V=(t,i={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:i.countAnsiEscapeCodes??!1,ellipsis:i.ellipsis??"",ellipsisWidth:i.ellipsisWidth??(i.ellipsis?V(i.ellipsis,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:i.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:i.ambiguousIsNarrow??!1,ansi:i.ansiWidth??0,control:i.controlWidth??0,emoji:i.emojiWidth??2,fullWidth:i.fullWidth??2,halfWidth:i.halfWidth??1,regular:i.regularWidth??1,tab:i.tabWidth??8,wide:i.wideWidth??2}},o=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:h}=t,s=h>1e4;let r=0,n=0,a=h,c=!1;const l=t.includes("\x1B")||t.includes("");for(;r<h;){if(l&&(t[r]==="\x1B"||t[r]==="")){if(t.startsWith("\x1B]8;;",r)){const g="\x1B]8;;\x07",f=g.length,b=t.indexOf("\x07",r+5);if(b!==-1){const W=t.indexOf(g,b+1);if(W!==-1){const x=W+f,y=t.slice(b+1,W).replace(ht,""),R=V(y,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,o-n),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),A=R.width;if(R.truncated)c=!0,a=Math.min(a,r);else if(n+A>o&&(a=Math.min(a,r),c=!0,n+A>e.truncation.limit))break;if(n+=A,r=x,c&&n>=e.truncation.limit)break;continue}}}if(Q.lastIndex=r,Q.test(t)){const g=Q.lastIndex-r,f=e.truncation.countAnsiEscapeCodes?g:e.width.ansi;if(n+f>o&&(a=Math.min(a,r),n+f>e.truncation.limit)){c=!0;break}n+=f,r=Q.lastIndex;continue}}const u=t.codePointAt(r);if(u===8203||u===65279||u>=8288&&u<=8292){r+=1;continue}if(u===9){if(n+e.width.tab>o&&(a=Math.min(a,r),n+e.width.tab>e.truncation.limit)){c=!0;break}n+=e.width.tab,r+=1;continue}if(X.lastIndex=r,X.test(t)){const g=(X.lastIndex-r)*e.width.regular;if(n+g>o){const f=e.width.regular>0?Math.floor((o-n)/e.width.regular):0;if(a=Math.min(a,r+f),n+g>e.truncation.limit){c=!0;break}}n+=g,r=X.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(Z.lastIndex=r,Z.test(t))){const g=(Z.lastIndex-r)*e.width.control;if(n+g>o){const f=e.width.control>0?Math.floor((o-n)/e.width.control):0;if(a=Math.min(a,r+f),n+g>e.truncation.limit){c=!0;break}}n+=g,r=Z.lastIndex;continue}if(dt.lastIndex=r,dt.test(t)){if(n+e.width.emoji>o&&(a=Math.min(a,r),n+e.width.emoji>e.truncation.limit)){c=!0;break}n+=e.width.emoji,r=dt.lastIndex;continue}const w=t.codePointAt(r)??0;if(Ti(w)){r+=w>65535?2:1;continue}let p;if(s)p=Ji(w,e);else switch(Ht(w)){case"control":{p=e.width.control;break}case"latin":{p=e.width.regular;break}case"wide":{p=e.width.wide;break}case"zero":{p=0;break}default:switch(Ot(w)){case"ambiguous":{p=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{p=e.width.fullWidth;break}case"wide":{p=e.width.wide;break}default:p=e.width.regular}}if(n+p>o&&(a=Math.min(a,r),n+p>e.truncation.limit)){c=!0;break}n+=p,r+=w>65535?2:1}let d=n,m=!1;return c&&e.truncation.limit>=e.truncation.ellipsisWidth&&(d=e.truncation.limit,m=!0),{ellipsed:m,index:c?a:h,truncated:c,width:d}},M=(t,i={})=>V(t,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;class Oi{capacity;cache;constructor(i){this.capacity=i,this.cache=new Map}get(i){if(!this.cache.has(i))return;const e=this.cache.get(i);return this.cache.delete(i),this.cache.set(i,e),e}has(i){return this.cache.has(i)}set(i,e){if(this.cache.has(i))this.cache.delete(i);else if(this.cache.size>=this.capacity){const o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}this.cache.set(i,e)}delete(i){this.cache.delete(i)}clear(){this.cache.clear()}size(){return this.cache.size}}const vt=new Oi(100),_i=new Intl.Segmenter("en",{granularity:"grapheme"}),$i=/^[\u0000-\u007F]*$/,Hi=new Set(["0","22","23","24","27","28","29","39","49"]),Gi=new Set(["1","3","4","7","8","9"]),Rt=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),tt=t=>t>="30"&&t<="37"||t>="90"&&t<="97"||t.startsWith("38;"),it=t=>t>="40"&&t<="47"||t>="100"&&t<="107"||t.startsWith("48;"),Pi=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],St=(t,i)=>{let e=-1;for(const o of i){const h=t.indexOf(o);h!==-1&&(e===-1||h<e)&&(e=h)}return e},Vi=(t,i)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:M(t,i.width)}];const e=`${JSON.stringify(i.width??void 0)}\0${t}`,o=vt.get(e);if(o)return o;const h=[],s=[];let r=0,n;for(ht.lastIndex=0;(n=ht.exec(t))!==null;){const d=n[0];h.push(t.slice(r,n.index)),s.push(d),r=n.index+d.length}r<t.length&&h.push(t.slice(r));const a=[];for(const d of s){if(d==="\x1B[0m"||d==="\x1B]8;;\x07"){a.push(d);continue}if(d.startsWith("\x1B[")&&d.endsWith("m")){const m=d.slice(2,-1);if(Hi.has(m)){a.push(d);continue}}}const c=new Set,l=[];for(const[d,m]of h.entries()){if(d>0&&s[d-1]){const p=s[d-1];if(p==="\x1B[0m")c.clear();else if(p==="\x1B]8;;\x07"){for(const g of c)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){c.delete(g);break}}else if(p.startsWith("\x1B[")&&p.endsWith("m")){const g=p.slice(2,-1);if(g==="39"){for(const f of c)if(f.startsWith("\x1B[")&&f.endsWith("m")){const b=f.slice(2,-1);if(tt(b)){c.delete(f);break}}}else if(g==="49"){for(const f of c)if(f.startsWith("\x1B[")&&f.endsWith("m")){const b=f.slice(2,-1);if(it(b)){c.delete(f);break}}}else if(Rt.has(g)){const f=Rt.get(g);for(const b of c)if(b===`\x1B[${f}m`){c.delete(b);break}}else{if(tt(g)){for(const f of c)if(f.startsWith("\x1B[")&&f.endsWith("m")){const b=f.slice(2,-1);if(tt(b)){c.delete(f);break}}}else if(it(g)){for(const f of c)if(f.startsWith("\x1B[")&&f.endsWith("m")){const b=f.slice(2,-1);if(it(b)){c.delete(f);break}}}else if(Gi.has(g)){const f=`\x1B[${g}m`;c.has(f)&&c.delete(f)}c.add(p)}}else if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){for(const g of c)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){c.delete(g);break}c.add(p)}}if(m==="")continue;let u="";if(c.size>0)if(a.includes("\x1B[0m"))u="\x1B[0m";else{const p=[];let g=!1;for(const x of c)if(x.startsWith("\x1B]8;;")&&!x.endsWith("\x1B]8;;\x07")){g=!0;break}g&&a.includes("\x1B]8;;\x07")&&p.push("\x1B]8;;\x07");let f=!1,b=!1;for(const x of c)if(x.startsWith("\x1B[")&&x.endsWith("m")){const y=x.slice(2,-1);tt(y)?f=!0:it(y)&&(b=!0)}if(f&&b){const x=St(t,["\x1B[3","\x1B[9","\x1B[38;"]),y=St(t,["\x1B[4","\x1B[10","\x1B[48;"]);x>=0&&y>=0?x>y?p.push("\x1B[39m","\x1B[49m"):p.push("\x1B[49m","\x1B[39m"):p.push("\x1B[39m","\x1B[49m")}else f&&p.push("\x1B[39m"),b&&p.push("\x1B[49m");f&&b&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(p.length-=2,p.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(p.length-=2,p.push("\x1B[49m","\x1B[39m")));const W=Pi.filter(x=>c.has(x.open)).map(x=>({position:t.indexOf(x.open),style:x})).filter(x=>x.position>=0).toSorted((x,y)=>y.position-x.position);for(const x of W){const y=x;a.includes(y.style.close)&&p.push(y.style.close)}u=p.join("")}const w=[...c].join("");l.push({after:u,before:w,content:m,visibleLength:M(m,i.width)})}return vt.set(e,l),l},At=(t,i,e,o)=>{const h=[...o.segmenter.segment(t)],s=[];let r=0,n=!1;for(const a of h){const c=M(a.segment,o.width),l=r,d=r+c;if(!n)if(l<i){r=d;continue}else n=!0;if(l>=e||d>e)break;s.push(a.segment),r=d}return s.join("")},F=(t,i=0,e=Number.MAX_SAFE_INTEGER,o={})=>{const h={segmenter:_i,...o};if(i>=e||t==="")return"";const s=M(t,h.width);if(i===0&&e>=s)return t;if(i<0||e<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return $i.test(t)?t.slice(i,e):At(t,i,e,h);if(yt.lastIndex=0,Wt.lastIndex=0,!yt.test(t)&&!Wt.test(t))return t;const r=Vi(t,h);if(r.length===0)return"";let n=0;const a=[];for(const[d,m]of r.entries()){const u=n,w=n+m.visibleLength;if(w>i&&u<e){const p=Math.max(0,i-u),g=Math.min(m.visibleLength,e-u);a.push({end:g,index:d,segment:m,start:p})}n=w}if(a.length===0)return"";const c=[],l=a[0].segment;c.push(l.before);for(let d=0;d<a.length;d++){const{end:m,segment:u,start:w}=a[d];if(w===0&&m===u.visibleLength?c.push(u.content):c.push(At(u.content,w,m,h)),d<a.length-1){const p=a[d+1].segment,g=u.after,f=p.before;g!==f&&(g||f)&&c.push(g,f)}}return c.push(a.at(-1).segment.after),c.join("")},Ct="…",qi=3,et=(t,i,e=!1)=>{if(t.charAt(i)===" ")return i;const o=e?1:-1,h=Math.min(qi,e?t.length-i:i);for(let s=1;s<=h;s++){const r=i+s*o;if(t.charAt(r)===" ")return r}return i},ot=(t,i,e)=>V(t,{...e,ellipsis:"",ellipsisWidth:0,limit:i}).index,rt=(t,i,e)=>M(t.slice(0,i),e),It=(t,i,e={})=>{if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof i!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof i}`);if(t===""||i<=0)return"";const o=t.normalize("NFC"),{ellipsis:h=Ct,position:s="end",preferTruncationOnSpace:r=!1}=e;let n=e.ellipsisWidth??(h===Ct?1:void 0);n??=V(h,{...e.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:a}=V(o,{...e.width,ellipsis:h,ellipsisWidth:n});if(a<=i)return o;switch(s){case"end":{if(r){const c=i-n,l=ot(o,c,e.width),d=et(o,l),m=rt(o,d,e.width);return F(o,0,m,{width:e.width})+h}return F(o,0,i-n,{width:e.width})+h}case"middle":{const c=Math.floor(i/2),l=Math.max(0,i-n),d=Math.min(c,l),m=Math.max(0,l-d);if(r){const u=ot(o,d,e.width),w=et(o,u),p=rt(o,w,e.width),g=a-m,f=ot(o,g,e.width),b=et(o,f,!0),W=rt(o,b,e.width);return F(o,0,p,{width:e.width})+h+F(o,W,a,{width:e.width}).trim()}return F(o,0,d,{width:e.width})+h+F(o,a-m,a,{width:e.width})}case"start":{if(r){const c=a-i+n,l=ot(o,c,e.width),d=et(o,l,!0),m=rt(o,d,e.width);return h+F(o,m,a,{width:e.width}).trim()}return h+F(o,a-i+n,a,{width:e.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${s}'`)}},zi=/\x1B\[(\d+)m/;class Gt{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(i){const e=zi.exec(i);if(!e)return;const o=Number.parseInt(e[1],10);switch(o){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(o>=30&&o<=37||o>=90&&o<=97)this.activeForeground=i;else if(o>=40&&o<=47||o>=100&&o<=107)this.activeBackground=i;else if([1,2,3,4,7,8,9].includes(o))this.activeFormatting.push(i);else if([22,23,24,27,28,29].includes(o)){const h={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[o];h&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(h)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const i=[];if(this.activeFormatting.length>0){const e={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(o=>{const h=e[o];h&&i.push(h)})}return this.activeForeground&&i.push("\x1B[39m"),this.activeBackground&&i.push("\x1B[49m"),i.join("")}}const Di=(t,i)=>{if(!q.has(t[i]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const e=!0,o=t.slice(i+1,i+1+K.length).join("")===K;return{isInsideEscape:e,isInsideLinkEscape:o}},Yi=(t,i={})=>{const e=new Gt;let o="",h=!1,s="",r="",n=!1;const a=[...t];for(let c=0;c<a.length;c++){const l=a[c];if(l&&q.has(l)){if(o){const p=i.getWidth?.(o)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:o,width:p};if(n&&(g.isHyperlink=!0,g.hyperlinkUrl=r),i.onSegment?.(g,e)===!1)return;o=""}h=!0,s=l;const u=Di(a,c),{isInsideLinkEscape:w}=u;if(w){let p=c+1;for(r="";p<a.length;){const f=a[p];if(f===lt)break;r+=f,p+=1}r=r.slice(4);const g={hyperlinkUrl:r,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(i.onSegment?.(g,e)===!1)return;c=p,n=!0,h=!1,s="";continue}if(c+1<a.length&&a[c+1]==="\\"&&n){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(i.onSegment?.(p,e)===!1)return;n=!1,r="",c+=1,h=!1,s="";continue}}if(h){if(s!==l&&(s+=l),l===gt){h=!1,e.processEscape(s);const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(i.onSegment?.(u,e)===!1)return;s=""}continue}o+=l;const d=i.getWidth?.(o)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:o,width:d};if(n&&(m.isHyperlink=!0,m.hyperlinkUrl=r),i.onSegment?.(m,e)===!1)return;o=""}if(o){const c=i.getWidth?.(o)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:o,width:c};n&&(l.isHyperlink=!0,l.hyperlinkUrl=r),i.onSegment?.(l,e)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};i.onSegment?.(c,e)}},Mt=t=>`${q.values().next().value}${$t}${String(t)}${gt}`,Et=t=>`${q.values().next().value}${K}${t}${lt}`,Ki=t=>{if(t.length===0)return"";if(t.length===1)return t[0];let i="",e,o;const h=t.join(`
|
|
2
|
+
`),s=[...h];let r=0;for(const[n,a]of s.entries()){if(i+=a,q.has(a)){const l=ki.exec(h.slice(r))?.groups??{};if(l.code!==void 0){const d=Number.parseFloat(l.code);e=d===Mi?void 0:d}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}const c=ji.get(Number(e));s[n+1]===`
|
|
3
|
+
`?(o&&(i+=Et("")),e&&c&&(i+=Mt(c))):a===`
|
|
4
|
+
`&&(e&&c&&(i+=Mt(e)),o&&(i+=Et(o))),r+=a.length}return i},Pt=/(?=\s)|(?<=\s)/,Vt=/^\s+$/,kt=new Map,Ui=t=>{const i=kt.get(t);if(i!==void 0)return i;const e=M(t);return kt.set(t,e),e},ut=t=>{if(!t.includes("\x1B"))return t;let i=t;return t.includes("\x1B[30m")&&(i+="\x1B[39m"),t.includes("\x1B[42m")&&(i+="\x1B[49m"),i},O=t=>{const i=t.split(" ");let e=i.length;for(;e>0&&M(i[e-1])===0;)e--;return e===i.length?t:i.slice(0,e).join(" ")+i.slice(e).join("")},qt=(t,i,e)=>{if(t.length===0)return[""];if(i<=0)return[t];const o=[],h=new Gt;let s="",r=0,n=!1,a=!1,c="",l=0;for(;l<t.length;){const d=t.codePointAt(l),m=String.fromCodePoint(d),u=m.length;if(q.has(m)){n=!0,c=m,s+=m,a=t.startsWith(K,l+1),l+=1;continue}if(n){c+=m,s+=m,a?m===lt&&(n=a=!1):m===gt&&(n=!1,h.processEscape(c)),l+=1;continue}const w=Ui(m),p=m===" ";if(w===0){s+=m,l+=u;continue}if(r+w>i&&(s&&o.push(s+h.getEndEscapesForAllActiveAttributes()),s=h.getStartEscapesForAllActiveAttributes(),r=M(s),p&&e)){for(;l<t.length&&t[l]===" ";)l+=1;continue}if(s+=m,r+=w,r===i&&l+u<t.length&&(o.push(s+h.getEndEscapesForAllActiveAttributes()),s=h.getStartEscapesForAllActiveAttributes(),r=M(s),l+u<t.length&&t[l+u]===" "&&e)){for(l+=u;l<t.length&&t[l]===" ";)l+=1;continue}l+=u}return s&&o.push(s+h.getEndEscapesForAllActiveAttributes()),e?o.map(d=>O(d)):o},Zi=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const h=[];let s="",r=0;return Yi(o,{getWidth:M,onSegment:(n,a)=>{const c=n.text??"";if(n.isEscapeSequence)s+=c;else{const l=c===" ";if(n.width===0)return s+=c,!0;if(r+n.width>i&&(s&&h.push(s),s=a.getStartEscapesForAllActiveAttributes(),r=0,l))return e||h.push(a.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,r+=n.width}return!0}}),s&&h.push(s),e?h.map(n=>O(n)):h},Qi=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const h=o.split(Pt),s=[];let r="",n=0,a=0;for(;a<h.length;){const c=h[a],l=Vt.test(c),d=M(c);if(c.length===0){a+=1;continue}if(e&&l&&n===0){a+=1;continue}if(n+d>i&&n>0){e?s.push(O(r)):s.push(r),r="",n=0;continue}r+=c,n+=d,a+=1}return r&&(e?s.push(O(r)):s.push(r)),s},Xi=(t,i,e)=>{if(t.length===0)return[];const o=e?t.trim():t;if(o.length===0)return[];const h=o.split(Pt),s=[];let r="",n=0,a=0;for(;a<h.length;){const c=h[a],l=Vt.test(c),d=M(c);if(c.length===0){a+=1;continue}if(e&&l&&n===0){a+=1;continue}if(d>i){r&&s.push(ut(e?O(r):r));const m=qt(c,i,e);if(m.length>0){for(let u=0;u<m.length-1;u+=1)s.push(m[u]);r=m.at(-1),n=M(r)}else r="",n=0;a+=1;continue}if(n+d>i&&n>0&&(s.push(ut(e?O(r):r)),r="",n=0,e&&l)){a+=1;continue}r+=c,n+=d,a+=1}return r&&s.push(ut(e?O(r):r)),s},nt={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},te=(t,i={})=>{const{removeZeroWidthCharacters:e=!0,trim:o=!0,width:h=80,wrapMode:s=nt.PRESERVE_WORDS}=i;if(o&&t.trim()==="")return"";let r=t.normalize("NFC").replaceAll(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`);return e&&(r=r.replaceAll(Ei,"")),r.split(`
|
|
7
|
+
`).map(n=>{if(o&&n.trim()==="")return"";let a;switch(s){case nt.BREAK_AT_CHARACTERS:{a=Zi(n,h,o);break}case nt.BREAK_WORDS:{a=Xi(n,h,o);break}case nt.STRICT_WIDTH:{a=qt(n,h,o);break}default:a=Qi(n,h,o)}return Ki(a)}).join(`
|
|
8
|
+
`)},zt=80,Dt=24,mt=(t,i,{shell:e,env:o}={})=>ri(t,i,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:e,env:o}).trim(),st=(t,i)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(i,10)}),Yt=(t,i)=>{const{columns:e,rows:o}=st(t,i);if(!(Number.isNaN(e)||Number.isNaN(o))&&!(e===zt&&o===Dt))return{columns:e,rows:o}},ie=()=>{if(J.platform!=="linux")return!0;try{const t=Y.readFileSync("/proc/self/stat","utf8"),i=t.lastIndexOf(") ");if(i===-1)return!1;const e=t.slice(i+2).trim().split(/\s+/),o=Number.parseInt(e[2],10),h=Number.parseInt(e[5],10);return Number.isNaN(o)||Number.isNaN(h)||h<=0?!1:o===h}catch{return!1}};function ee(){const{env:t,stdout:i,stderr:e}=J;if(i?.columns&&i?.rows)return st(i.columns,i.rows);if(e?.columns&&e?.rows)return st(e.columns,e.rows);if(t.COLUMNS&&t.LINES)return st(t.COLUMNS,t.LINES);const o={columns:zt,rows:Dt};return J.platform==="win32"?ft()??o:J.platform==="darwin"?jt()??ft()??o:jt()??ft()??oe()??o}const jt=()=>{try{const t=J.platform==="darwin"?Y.constants.O_EVTONLY|Y.constants.O_NONBLOCK:Y.constants.O_NONBLOCK,{columns:i,rows:e}=ni.WriteStream(Y.openSync("/dev/tty",t));return{columns:i,rows:e}}catch{}},ft=()=>{try{const t=mt("tput",["cols"],{env:{TERM:"dumb",...J.env}}),i=mt("tput",["lines"],{env:{TERM:"dumb",...J.env}});if(t&&i)return Yt(t,i)}catch{}},oe=()=>{try{if(!ie())return;const t=mt("resize",["-u"]).match(/\d+/g);if(t.length===2)return Yt(t[0],t[1])}catch{}},H=(t,i)=>{switch(i){case"bottom":return{body:t.bottomBody,join:t.bottomJoin,left:t.bottomLeft,right:t.bottomRight};case"middle":return{body:t.joinBody,join:t.joinJoin,left:t.joinLeft,right:t.joinRight};case"top":return{body:t.topBody,join:t.topJoin,left:t.topLeft,right:t.topRight};default:throw new Error(`Invalid borderType: ${String(i)}`)}},re=t=>({join:t.bodyJoin,left:t.bodyLeft,right:t.bodyRight}),at=(t,i,e,o=1)=>{let h=0;for(let s=0;s<e;s+=1)h+=t[i+s]??0;return e>1&&(h+=(e-1)*o),h},wt=(t,i,e,o)=>{let h=i;for(;h>0&&t[h-1]?.[e]===o;)h-=1;let s=i;for(;s<t.length-1&&t[s+1]?.[e]===o;)s+=1;let r;const n=s-h+1;if(n===1)r=!0;else switch(o.vAlign){case"bottom":{r=i===s;break}case"middle":{const a=h+Math.floor(n/2);r=i===a;break}case"top":{r=i===h;break}default:r=i===h}return{firstRow:h,lastRow:s,showContent:r}},ne=(t,i,e,o,h)=>{if(t.length===0)return[];const s=e.showBorders?e.border?.bodyJoin.width??0:0,r=e.showBorders&&(e.border?.joinBody.width??0)>0;let n=t.length-1;for(let l=0;l<t.length;l+=1){const d=t[l];if(d){for(const[m,u]of d.entries())if(u&&h(t,l,m,u)===l){const w=wt(t,l,m,u);n=Math.max(n,w.lastRow)}}}const a=Array.from({length:n+1}).fill(1);for(let l=0;l<t.length;l+=1){const d=t[l];if(d)for(let m=0;m<e.columns;m+=1){const u=d[m];if(u&&h(t,l,m,u)===l&&(u.rowSpan??1)===1){const w=u.colSpan??1,p=at(i,m,w,s),g=o(u,p).length;a[l]=Math.max(a[l]??1,g)}}}const c=Array.from({length:a.length}).fill(!1);if(e.fixedRowHeights)for(let l=0;l<a.length;l+=1){let d;e.fixedRowHeights[l]!==void 0?d=e.fixedRowHeights[l]:e.fixedRowHeights.length===1&&e.fixedRowHeights[0]!==void 0&&(d=e.fixedRowHeights[0]),d!==void 0&&(a[l]=Math.max(1,d),c[l]=!0)}for(let l=0;l<t.length;l+=1){const d=t[l];if(d)for(let m=0;m<e.columns;m+=1){const u=d[m];if(u&&h(t,l,m,u)===l&&(u.rowSpan??1)>1){const w=u.colSpan??1,p=at(i,m,w,s),g=o(u,p),f=r?g.length-1:g.length,b=wt(t,l,m,u),{firstRow:W,lastRow:x}=b;let y=0,R=0;for(let v=W;v<=x&&v<a.length;v+=1)y+=a[v]??1,c[v]||(R+=1);const A=f-y;if(A>0)if(R>0){const v=Math.ceil(A/R);let B=0;for(let C=W;C<=x&&C<a.length;C+=1)if(!c[C]){const E=Math.min(v,A-B);if(a[C]=(a[C]??1)+E,B+=E,B>=A)break}}else(e.onWarn??(v=>{console.warn(v)}))(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(u.content)}, Required: ${String(f)}, Allocated: ${String(y)} (fixed).`)}}}return a},G=(t,i,e,o)=>{let h=i;for(;h>0&&t[h-1]?.[e]===o;)h-=1;return h},Nt=t=>{if(typeof t=="string")return{content:t};if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")return{content:String(t)};if(t==null)return{content:"",isEmpty:!0};if(typeof t=="object"&&"content"in t){let{content:i}=t,e=!1;if(typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=String(i);else if(i==null)i="",e=!0;else if(typeof i!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`);return e?{...t,content:i,isEmpty:!0}:{...t,content:i}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`)},se=(t,i,e,o,h)=>{const s=M(t),r=" ".repeat(Math.max(0,o)),n=" ".repeat(Math.max(0,h));if(s===0)return r+" ".repeat(Math.max(0,i))+n;const a=Math.max(0,i-s);switch(e){case"center":{const c=Math.floor(a/2),l=a-c;return r+" ".repeat(c)+t+" ".repeat(l)+n}case"right":return r+" ".repeat(a)+t+n;default:return r+t+" ".repeat(a)+n}},Lt=/\r?\n/,Ft=/\s+/;let Jt;const he=()=>(Jt??=ee().columns,Jt),S=(t,i)=>!t||!i?t:typeof i=="function"?i(t):i.open+t+i.close;class ct{#t;#e=[];#o;#n=new WeakMap;#r=new WeakMap;#i=new WeakMap;#s(i){const e=this.#i.get(i);if(e)return e;const o=String(i.content??"").split(Lt);let h=0;for(const r of o)h=Math.max(h,M(r));const s={lines:o,maxLineWidth:h};return this.#i.set(i,s),s}#h(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}static createGridLayout(){return[]}static calculateImplicitRowCount(i,e){let o=0;for(const h of i)o+=(h.colSpan??1)*(h.rowSpan??1);return Math.max(1,Math.ceil(o/e))}constructor(i){const e={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:i.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let o;Array.isArray(i.fixedRowHeights)?o=i.fixedRowHeights:typeof i.fixedRowHeights=="number"&&(o=[i.fixedRowHeights]),this.#t={...e,...i,columns:i.columns,fixedRowHeights:o,showBorders:i.border!==void 0||(i.showBorders??!1)};const{terminalWidth:h}=this.#t;this.#o=h??he(),this.#t.maxWidth&&(this.#t.maxWidth=Math.min(this.#t.maxWidth,this.#o))}addItem(i){const e=Nt(i);return this.#a(e),this.#e.push(e),this}#a(i){i.width!==void 0&&this.#h("@visulima/tabular: GridItem.width is ignored by Grid (it is only consumed by Table). Use fixedColumnWidths or maxWidth to constrain Grid column widths.")}addItems(i){for(const e of i){const o=Nt(e);this.#a(o),this.#e.push(o)}return this}setColumns(i){return this.#t.columns=i,this}setRows(i){return this.#t.rows=i,this}setBorder(i){return this.#t.border=i,this}setShowBorders(i){return this.#t.showBorders=i,this}setMaxWidth(i){return this.#t.maxWidth=i,this}toString(){const i=ct.createGridLayout();if(this.#n=new WeakMap,this.#r=new WeakMap,this.#i=new WeakMap,this.placeItems(i),i.length===0||i[0]?.length===0)return"";let e=this.calculateColumnWidths(i);const o=this.calculateTotalGridWidth(e),h=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o;return o>h&&(e=this.adjustColumnWidthsForTerminal(e,o)),this.renderGrid(i,e)}placeItems(i){let e=0,o=0;const h=this.#t.rows>0?this.#t.rows:Number.POSITIVE_INFINITY,s=this.#t.rows>0?this.#t.rows:ct.calculateImplicitRowCount(this.#e,Math.max(1,this.#t.columns));for(let r=0;r<this.#e.length;r+=1){const n=this.#e[r];if(n.isEmpty&&!(n.rowSpan&&n.rowSpan>1)&&!(n.colSpan&&n.colSpan>1)){this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=s&&(e=0,o+=1));continue}const a=n.colSpan??1,c=n.rowSpan??1;let l=!1,d=e,m=o,u=0;const w=((this.#t.autoFlow==="column"?Math.max(i.length,s):i.length)+c+5)*this.#t.columns,p=a<=this.#t.columns;for(;p&&!l&&d<h&&u<w;){for(u+=1;d+c>i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));if(this.canPlaceItem(i,d,m,a,c))this.placeItem(i,d,m,n),l=!0,this.#t.autoFlow==="row"?(o=m+a,e=d,o>=this.#t.columns&&(o=0,e+=1)):(e=d+c,o=m,e>=s&&(e=0,o+=1));else if(this.#t.autoFlow==="row")m+=1,m>=this.#t.columns&&(m=0,d+=1);else if(d+=1,d>=s&&(d=0,m+=1,m>=this.#t.columns))break}l||(this.#h(`@visulima/tabular: Could not find position for item: ${JSON.stringify(n)} after ${String(u)} attempts. Grid might be too small or layout impossible.`),this.#t.autoFlow==="row"?(o+=1,o>=this.#t.columns&&(o=0,e+=1)):(e+=1,e>=s&&(e=0,o+=1)))}if(this.#t.rows>0){if(i.length>0)for(;i.length<this.#t.rows;)i.push(Array.from({length:this.#t.columns}).fill(void 0))}else for(;i.length>0&&i.at(-1)?.every(r=>r===void 0);)i.pop()}canPlaceItem(i,e,o,h,s,r=!1){if(o+h>this.#t.columns)return!1;for(let n=e;n<e+s;n+=1)if(n<i.length){if(!i[n])return this.#h(`Grid layout unexpectedly missing row ${String(n)} during canPlaceItem check.`),!1;for(let a=o;a<o+h;a+=1)if(i[n]?.[a]!==void 0)return!1}else if(!r)return!1;return!0}computeWrappedContentWidth(i,e,o,h){let s=i;if(h){if(s>20){let r=0;for(const n of e){const a=n.split(Ft);for(const c of a)r=Math.max(r,Math.min(M(c),o))}s=Math.min(s,Math.max(r+4,12))}}else{let r=0;for(const n of e){const a=n.split(Ft);for(const c of a)r=Math.max(r,Math.min(M(c),o))}s=Math.min(s,Math.max(r+12,20))}return s}placeItem(i,e,o,h){const s=h.rowSpan??1,r=h.colSpan??1;for(let n=e;n<e+s;n+=1){for(;n>=i.length;)i.push(Array.from({length:this.#t.columns}).fill(void 0));for(let a=o;a<o+r;a+=1)a<this.#t.columns&&(i[n]||(this.#h(`Logic error: Row ${String(n)} not found in placeItem despite check.`),i[n]=Array.from({length:this.#t.columns}).fill(void 0)),i[n][a]=h)}}calculateTotalGridWidth(i){let e=0;const o=this.#t.showBorders?this.#t.border:void 0;o&&(e+=o.bodyLeft.width,e+=o.bodyRight.width);const h=i.length,s=this.#t.showBorders?o?.bodyJoin.width??0:0,r=this.#t.gap;for(let n=0;n<h;n+=1)e+=i[n]??0,n<h-1&&(e+=r,e+=s);return e}adjustColumnWidthsForTerminal(i,e){const o=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth??0,this.#o):this.#o;if(e<=o)return i;let h=0;const s=i.length,r=this.#t.showBorders?this.#t.border:void 0;if(r&&(h+=r.bodyLeft.width,h+=r.bodyRight.width),s>1){h+=(s-1)*this.#t.gap;const m=r?.bodyJoin.width??0;h+=(s-1)*m}if(h>=o)return Array.from({length:s}).fill(1);const n=o-h,a=i.reduce((m,u)=>m+u,0);if(a===0){const m=Math.floor(n/s);return Array.from({length:s}).fill(m)}const c=i.map(m=>{const u=m/a;return Math.max(1,Math.floor(n*u))});let l=c.reduce((m,u)=>m+u,0)-n;for(;l>0;){let m=-1;for(let u=0;u<c.length;u+=1)(c[u]??0)>1&&(m===-1||(c[u]??0)>(c[m]??0))&&(m=u);if(m===-1)break;c[m]-=1,l-=1}let d=n-c.reduce((m,u)=>m+u,0);if(d>0){const m=c.map((u,w)=>{const p=a>0?(i[w]??0)/a:1/s;return{index:w,remainder:n*p%1}}).toSorted((u,w)=>w.remainder-u.remainder);for(const u of m){if(d<=0)break;const{index:w}=u;c[w]!==void 0&&(c[w]+=1,d-=1)}}return c}calculateBalancedColumnWidths(i){const e=this.calculateMinimumColumnWidthsWithGrowableInfo(i),o=e.widths,{growableColumns:h}=e,s=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,r=this.#t.showBorders?this.#t.border:void 0;let n=0;if(r&&(n+=r.bodyLeft.width,n+=r.bodyRight.width),this.#t.columns>1){n+=(this.#t.columns-1)*this.#t.gap;const l=r?.bodyJoin.width??0;n+=(this.#t.columns-1)*l}const a=Math.max(0,s-n);if(o.reduce((l,d)=>l+d,0)>0){const l=Math.floor(a/this.#t.columns),d=Array.from({length:this.#t.columns}).fill(l),m=l*this.#t.columns;let u=a-m;for(let f=0;f<d.length&&u>0;f+=1)d[f]=(d[f]??0)+1,u-=1;const w=[];let p=0;for(let f=0;f<this.#t.columns;f+=1){const b=d[f]??0,W=o[f]??0,x=Math.max(b,W);w.push(x),p+=x}if(p>a){const f=a/p,b=w.map(y=>Math.max(3,Math.floor(y*f))),W=b.reduce((y,R)=>y+R,0);let x=a-W;for(let y=0;y<b.length&&x>0;y+=1)b[y]=(b[y]??0)+1,x-=1;return b}let g=a-p;if(g>0){const f=h.length>0?h:w.map((b,W)=>W);for(;g>0&&f.length>0;)for(const b of f){if(g<=0)break;w[b]=(w[b]??0)+1,g-=1}}return w}const c=Math.floor(a/this.#t.columns);return Array.from({length:this.#t.columns}).fill(c)}calculateMinimumColumnWidthsWithGrowableInfo(i){const e=Array.from({length:this.#t.columns}).fill(0),o=[],h=this.#t.paddingLeft+this.#t.paddingRight,s=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let r=0;r<this.#t.columns;r+=1)for(let n=0;n<i.length;n+=1){const a=i[n]?.[r];if(!a||G(i,n,r,a)!==n||r>0&&i[n]?.[r-1]===a)continue;const c=a.colSpan??1,l=a.maxWidth??Number.POSITIVE_INFINITY,{lines:d,maxLineWidth:m}=this.#s(a),u=this.#t.wordWrap&&a.wordWrap!==!1;let w=Math.min(m,l);w=this.computeWrappedContentWidth(w,d,l,u),c===1&&(e[r]=Math.max(e[r]??0,w+h),u&&!o.includes(r)&&o.push(r))}for(let r=0;r<i.length;r+=1)for(let n=0;n<this.#t.columns;n+=1){const a=i[r]?.[n];if(!a||G(i,r,n,a)!==r||n>0&&i[r]?.[n-1]===a)continue;const c=a.colSpan??1;if(c>1){const l=a.maxWidth??Number.POSITIVE_INFINITY,{lines:d,maxLineWidth:m}=this.#s(a),u=this.#t.wordWrap&&a.wordWrap!==!1;let w=Math.min(m,l);w=this.computeWrappedContentWidth(w,d,l,u);const p=(c-1)*s,g=w+h+p;let f=0;for(let W=n;W<n+c;W+=1)f+=e[W]??0;const b=f+p;if(g>b){const W=g-b,x=Math.floor(W/c);let y=0;for(let R=0;R<c&&n+R<this.#t.columns;R+=1){const A=Math.min(x,W-y);if(e[n+R]=(e[n+R]??0)+A,y+=A,y>=W)break}}}}return{growableColumns:o,widths:e}}calculateColumnWidths(i){if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns){const s=this.#t.fixedColumnWidths;if(!s.some(r=>r===void 0||!Number.isFinite(r)))return[...s];if(this.#t.balancedWidths){const r=Array.from({length:s.length}).fill(0),n=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#o):this.#o,a=this.calculateTotalGridWidth(Array.from({length:r.length}).fill(0)),c=Math.max(0,n-a);let l=0;const d=[];for(const[w,p]of s.entries())typeof p=="number"&&Number.isFinite(p)?(r[w]=p,l+=p):d.push(w);let m=Math.max(0,c-l);const u=d.length>0?Math.floor(m/d.length):0;for(const w of d)r[w]=u;m-=u*d.length;for(const w of d){if(m<=0)break;r[w]+=1,m-=1}return r}}if(this.#t.balancedWidths)return this.calculateBalancedColumnWidths(i);const e=Array.from({length:this.#t.columns}).fill(0),o=this.#t.paddingLeft+this.#t.paddingRight,h=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let s=0;s<this.#t.columns;s+=1)for(let r=0;r<i.length;r+=1){const n=i[r]?.[s];if(!n||G(i,r,s,n)!==r||s>0&&i[r]?.[s-1]===n)continue;const a=n.colSpan??1,c=n.maxWidth??Number.POSITIVE_INFINITY,{maxLineWidth:l}=this.#s(n),d=Math.min(l,c);a===1&&(e[s]=Math.max(e[s]??0,d+o))}for(let s=0;s<i.length;s+=1)for(let r=0;r<this.#t.columns;r+=1){const n=i[s]?.[r];if(!n||G(i,s,r,n)!==s||r>0&&i[s]?.[r-1]===n)continue;const a=n.colSpan??1;if(a>1){const c=n.maxWidth??Number.POSITIVE_INFINITY,{lines:l,maxLineWidth:d}=this.#s(n),m=this.#t.wordWrap&&n.wordWrap!==!1;let u=Math.min(d,c);u=this.computeWrappedContentWidth(u,l,c,m);let w=0;for(let b=r;b<r+a;b+=1)w+=e[b]??0;const p=a>1?(a-1)*h:0,g=u+o+p,f=w+p;if(g>f){const b=g-f,W=Math.floor(b/a);let x=0;for(let y=0;y<a&&r+y<this.#t.columns;y+=1){const R=Math.min(W,b-x);if(e[r+y]=(e[r+y]??0)+R,x+=R,x>=b)break}}}}if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns)for(const[s,r]of this.#t.fixedColumnWidths.entries())typeof r=="number"&&Number.isFinite(r)&&(e[s]=r);if(this.#t.maxWidth){const s=this.calculateTotalGridWidth(e);if(s>this.#t.maxWidth)return this.adjustColumnWidthsForTerminal(e,s)}return e}renderVisualRowContent(i,e,o,h,s){const r=i[e];if(!r)return"";const n=this.#t.borderColor??this.#t.foregroundColor??void 0,a=[],c=this.#t.showBorders&&this.#t.border?re(this.#t.border):void 0,l=c&&c.left.width>0?c.left.char:"",d=c&&c.right.width>0?c.right.char:"",m=c&&c.join.width>0?c.join.char:"",u=" ".repeat(this.#t.gap);l&&a.push(S(S(l,n),this.#t.backgroundColor));let w=0;for(;w<this.#t.columns;){const p=r[w]??void 0;let g=1,f;if(p){const b=p.colSpan??1;g=b;const W=G(i,e,w,p),x=this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0,y=at(h,w,b,x),R=this.alignCellContent(p,y),A=R.length,v=this.getCachedCellVerticalPosition(i,e,w,p);v.firstRow!==W&&this.#h(`Mismatch between findFirstOccurrenceRow (${String(W)}) and determineCellVerticalPosition (${String(v.firstRow)})`);const B=s.slice(W,v.lastRow+1).reduce((I,k)=>I+k,0),C=v.lastRow-v.firstRow+1;let E=o,L=0;const _=this.#t.showBorders&&(this.#t.border?.joinBody.width??0)>0;for(let I=W;I<e;I+=1)I<s.length&&(E+=s[I]??1),_&&I<v.lastRow&&(L+=1);E+=L;const T=p.vAlign??"top";let j;switch(T){case"bottom":{let I=o;for(let N=W;N<e;N+=1)I+=s[N]??1;const k=B-A;j=I>=k?I-k:-1;break}case"middle":{const I=Math.round((B-A)/2);let k=o;for(let N=W;N<e;N+=1)k+=s[N]??1;j=k>=I&&k<I+A?k-I:-1;break}case"top":{j=E;break}default:j=E}const z=j>=0&&j<A;if(f=" ".repeat(Math.max(0,y)),z){let I=!1;T==="middle"&&C%2===0&&j===0&&(I=!0),I||(f=R[j]??f)}p.colSpan&&p.colSpan>1&&(f+=u.repeat(p.colSpan)),p.foregroundColor?f=S(f,p.foregroundColor):this.#t.foregroundColor&&(f=S(f,this.#t.foregroundColor)),p.backgroundColor?f=S(f,p.backgroundColor):this.#t.backgroundColor&&(f=S(f,this.#t.backgroundColor))}else{const b=this.#t.paddingLeft+this.#t.paddingRight,W=Math.max(0,(h[w]??0)-b),x=" ".repeat(this.#t.paddingLeft+W+this.#t.paddingRight);f=S(S(o===0?x:" ".repeat(x.length),this.#t.foregroundColor),this.#t.backgroundColor)}a.push(f),w+g<this.#t.columns&&(a.push(u),this.#t.showBorders&&m&&a.push(S(S(m,n),this.#t.backgroundColor)),this.#t.gap>0&&a.push(u)),w+=g}return d&&a.push(S(S(d,n),this.#t.backgroundColor)),a.join("")}alignCellContent(i,e){const o=this.#n.get(i);if(o?.has(e))return o.get(e);const{paddingLeft:h,paddingRight:s}=this.#t,r=h+s,n=e-r;if(n<=0){const d=[" ".repeat(r+this.#t.gap)];return o?o.set(e,d):this.#n.set(i,new Map([[e,d]])),d}let a;const c=String(i.content??"");if(a=c.includes(`
|
|
9
|
+
`)||c.includes("\r")?c.split(Lt):[c],this.#t.wordWrap&&i.wordWrap!==!1){const d=typeof this.#t.wordWrap=="object"?this.#t.wordWrap:{},m=typeof i.wordWrap=="object"?i.wordWrap:d;a=te(c,{...m,width:n}).split(`
|
|
10
|
+
`)}if(this.#t.truncate&&i.truncate!==!1){const d=typeof this.#t.truncate=="object"?this.#t.truncate:{},m=typeof i.truncate=="object"?i.truncate:d;a=a.map(u=>It(u,n,m))}else this.#t.truncateOverflow&&(a=a.map(d=>M(d)>n?It(d,n,{}):d));const l=a.map(d=>se(d,n,i.hAlign??"left",h,s));return o?o.set(e,l):this.#n.set(i,new Map([[e,l]])),l}renderHorizontalBorder(i,e,o,h,s,r=-1){if(!this.#t.showBorders||!this.#t.border)return"";const n=this.#t.border,a=H(n,s),c=a.body.char,l=a.body.width,d=n.bodyJoin.char;if(s!=="middle"&&l===0)return"";let m=a.left.char,u=a.right.char;if(s==="middle"&&r!==-1){const f=i[o]?.[0]??void 0,b=i[r]?.[0]??void 0;f&&b&&f===b&&(m=d);const W=this.#t.columns-1,x=i[o]?.[W]??void 0,y=i[r]?.[W]??void 0;x&&y&&x===y&&(u=d)}const w=[],p=" ".repeat(this.#t.gap);m&&w.push(S(S(m,this.#t.borderColor),this.#t.backgroundColor));let g;for(let f=0;f<this.#t.columns;f+=1){const b=i[o]?.[f]??void 0,W=s==="middle"&&r!==-1?i[r]?.[f]??void 0:void 0;let x,y=!1;if(b&&(f===0||i[o]?.[f-1]!==b)&&(x=b,y=!0),b&&!y)continue;if(!b){const v=h[f]??0;if(g=l>0?c.repeat(v):" ".repeat(v),w.push(S(S(g,this.#t.borderColor),this.#t.backgroundColor)),f<this.#t.columns-1){const B=this.determineJoinChar(s,i,o,r,f,f+1);w.push(p),B.width>0&&w.push(S(S(B.char,this.#t.borderColor),this.#t.backgroundColor))}continue}const R=x?.colSpan??1;if(s==="middle"&&s==="middle"&&W&&b===W&&x){const v=x.vAlign==="middle",{firstRow:B,lastRow:C}=this.getCachedCellVerticalPosition(i,o,f,x),E=C-B+1,L=E%2===0,_=B+Math.ceil(E/2)-1,T=n.bodyJoin.width,j=at(h,f,R,T),z=this.alignCellContent(x,j),I=z.length;if(v&&L&&o===_)g=S(z[0]??"",this.#t.borderColor);else{let k=0;for(let $=B;$<=o;$+=1)k+=e[$]??1,$<o&&(k+=1);const N=k;if(N>=0&&N<I)g=S(z[N]??"",this.#t.foregroundColor);else{const $=h.slice(f,f+R).reduce((Kt,Ut)=>Kt+Ut,0)+(R-1)*(this.#t.gap+this.#t.border.bodyJoin.width);g=S(" ".repeat($),this.#t.borderColor)}}w.push(S(g,this.#t.backgroundColor))}else{const v=[];for(let B=f;B<f+R;B+=1){const C=h[B]??0,E=l>0?c:" ";if(v.push(E.repeat(C+this.#t.gap)),B<f+R-1){const L=this.determineJoinChar(s,i,o,r,B,B+1);L.width>0&&v.push(L.char)}}g=v.join(""),w.push(S(S(g,this.#t.borderColor),this.#t.backgroundColor))}const A=f+R-1;if(A<this.#t.columns-1){const v=this.determineJoinChar(s,i,o,r,A,A+1);v.width>0&&w.push(S(S(v.char,this.#t.borderColor),this.#t.backgroundColor))}f+=R-1}return u&&w.push(S(S(u,this.#t.borderColor),this.#t.backgroundColor)),w.join("")}determineJoinChar(i,e,o,h,s,r=-1){if(!this.#t.showBorders||!this.#t.border)return{char:" ",width:this.#t.gap};const n=this.#t.border;if(i!=="middle"){const y=H(n,i),R=e[o]?.[s]??void 0,A=r===-1?s+1:r,v=e[o]?.[A]??void 0,B=R!==void 0&&v!==void 0&&R===v?y.body:y.join,{char:C,width:E}=B;return{char:C,width:E>0?E:this.#t.gap}}if(h===-1||r===-1)return{char:" ",width:this.#t.gap};const a=n.bodyJoin,c=e[o]?.[s]??void 0,l=e[h]?.[s]??void 0,d=e[o]?.[r]??void 0,m=e[h]?.[r]??void 0,u=c!==void 0&&l!==void 0&&c===l,w=d!==void 0&&m!==void 0&&d===m,p=c!==void 0&&d!==void 0&&c===d,g=l!==void 0&&m!==void 0&&l===m;let f;const b=H(n,"middle");u&&w?f=p?{char:" ",width:a.width}:a:u?f=n.joinLeft:w?f=n.joinRight:p&&g?f=b.body:p?f=n.topJoin:g?f=n.bottomJoin:f=n.joinJoin;const{char:W,width:x}=f;return{char:W,width:x>0?x:this.#t.gap}}renderGrid(i,e){if(i.length===0)return"";const o=[],h=ne(i,e,this.#t,this.alignCellContent.bind(this),G),s=this.#t.showBorders&&this.#t.border?H(this.#t.border,"top"):void 0;s&&s.body.width>0&&o.push(this.renderHorizontalBorder(i,h,0,e,"top"));for(let n=0;n<i.length;n+=1){const a=h[n]??1;for(let l=0;l<a;l+=1)o.push(this.renderVisualRowContent(i,n,l,e,h));const c=this.#t.showBorders&&this.#t.border?H(this.#t.border,"middle"):void 0;if(n<i.length-1&&c&&c.body.width>0){const l=i[n],d=i[n+1];let m=!1;if(l&&d)for(let u=0;u<this.#t.columns;u+=1){const w=l[u],p=d[u];if(w!==p){m=!0;break}}m&&o.push(this.renderHorizontalBorder(i,h,n,e,"middle",n+1))}}const r=this.#t.showBorders&&this.#t.border?H(this.#t.border,"bottom"):void 0;return r&&r.body.width>0&&o.push(this.renderHorizontalBorder(i,h,i.length-1,e,"bottom")),o.join(`
|
|
11
|
+
`)}getCachedCellVerticalPosition(i,e,o,h){const s=this.#r.get(h);if(s)return s;const r=wt(i,e,o,h);return this.#r.set(h,r),r}}const ae={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},me={bodyJoin:{char:" ",width:1},bodyLeft:{char:" ",width:1},bodyRight:{char:" ",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"-",width:1},bottomLeft:{char:"-",width:1},bottomRight:{char:"-",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"-",width:1},joinLeft:{char:"-",width:1},joinRight:{char:"-",width:1},topBody:{char:"-",width:1},topJoin:{char:"-",width:1},topLeft:{char:"-",width:1},topRight:{char:"-",width:1}},we={bodyJoin:{char:"║",width:1},bodyLeft:{char:"║",width:1},bodyRight:{char:"║",width:1},bottomBody:{char:"═",width:1},bottomJoin:{char:"╩",width:1},bottomLeft:{char:"╚",width:1},bottomRight:{char:"╝",width:1},joinBody:{char:"═",width:1},joinJoin:{char:"╬",width:1},joinLeft:{char:"╠",width:1},joinRight:{char:"╣",width:1},topBody:{char:"═",width:1},topJoin:{char:"╦",width:1},topLeft:{char:"╔",width:1},topRight:{char:"╗",width:1}},pe={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"╰",width:1},bottomRight:{char:"╯",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"╭",width:1},topRight:{char:"╮",width:1}},ge={bodyJoin:{char:"┊",width:1},bodyLeft:{char:"┊",width:1},bodyRight:{char:"┊",width:1},bottomBody:{char:"┈",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"┈",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"┈",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},be={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"|",width:1},bottomLeft:{char:"|",width:1},bottomRight:{char:"|",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"|",width:1},joinLeft:{char:"|",width:1},joinRight:{char:"|",width:1},topBody:{char:"-",width:1},topJoin:{char:"|",width:1},topLeft:{char:"|",width:1},topRight:{char:"|",width:1}},xe={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"+",width:1},bottomLeft:{char:"+",width:1},bottomRight:{char:"+",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"+",width:1},joinLeft:{char:"+",width:1},joinRight:{char:"+",width:1},topBody:{char:"-",width:1},topJoin:{char:"+",width:1},topLeft:{char:"+",width:1},topRight:{char:"+",width:1}},ye={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}},We={bodyJoin:{char:"█",width:1},bodyLeft:{char:"█",width:1},bodyRight:{char:"█",width:1},bottomBody:{char:"█",width:1},bottomJoin:{char:"█",width:1},bottomLeft:{char:"█",width:1},bottomRight:{char:"█",width:1},joinBody:{char:"█",width:1},joinJoin:{char:"█",width:1},joinLeft:{char:"█",width:1},joinRight:{char:"█",width:1},topBody:{char:"█",width:1},topJoin:{char:"█",width:1},topLeft:{char:"█",width:1},topRight:{char:"█",width:1}},Be={bodyJoin:{char:"┃",width:1},bodyLeft:{char:"┃",width:1},bodyRight:{char:"┃",width:1},bottomBody:{char:"━",width:1},bottomJoin:{char:"┻",width:1},bottomLeft:{char:"┗",width:1},bottomRight:{char:"┛",width:1},joinBody:{char:"━",width:1},joinJoin:{char:"╋",width:1},joinLeft:{char:"┣",width:1},joinRight:{char:"┫",width:1},topBody:{char:"━",width:1},topJoin:{char:"┳",width:1},topLeft:{char:"┏",width:1},topRight:{char:"┓",width:1}},ce=t=>t.reduce((i,e)=>{if(e===null)return i+1;if(typeof e=="object"&&!Array.isArray(e)){const o=typeof e.colSpan=="number"?e.colSpan:1;return i+(o<=0?1:o)}return i+1},0),le=/[\u0000-\u001F\u007F-\u009F]/gu,de=t=>t.replaceAll(le,"");class ue{#t;#e=[];#o=[];#n=[];#r=!0;#i=void 0;#s(i){const e=this.#t.onWarn;if(e){e(i);return}console.warn(i)}constructor(i={}){this.#t={...i,showFooter:i.showFooter??!0,showHeader:i.showHeader??!0,style:{border:ae,paddingLeft:1,paddingRight:1,...i.style}}}setHeaders(i){return i.length>0&&!Array.isArray(i[0])?this.#o=[i]:this.#o=i.map(e=>Array.isArray(e)?e:[e]),this.#r=!0,this.#i=void 0,this}setFooter(i){return i.length>0&&!Array.isArray(i[0])?this.#n=[i]:this.#n=i.map(e=>Array.isArray(e)?e:[e]),this.#r=!0,this.#i=void 0,this}addRow(i){if(!Array.isArray(i))throw new TypeError("Row must be an array");return this.#e.push(i),this.#r=!0,this.#i=void 0,this}addRows(...i){for(const e of i)this.addRow(e);return this.#r=!0,this.#i=void 0,this}getRows(){return this.#e.map(i=>[...i])}get rowCount(){return this.#e.length}removeRow(i){if(!Number.isInteger(i)||i<0||i>=this.#e.length)throw new RangeError(`Row index ${String(i)} is out of bounds (0..${String(this.#e.length-1)})`);return this.#e.splice(i,1),this.#r=!0,this.#i=void 0,this}clear(){return this.#e.length=0,this.#r=!0,this.#i=void 0,this}toString(){if(!this.#r&&this.#i!==void 0)return this.#i;const i=this.#t.showHeader?this.#o:[],e=this.#t.showFooter?this.#n:[],o=[...i,...this.#e,...e];if(o.length===0)return this.#i="",this.#r=!1,"";let h=0;for(const u of o){const w=u;Array.isArray(w)?h=Math.max(h,ce(w)):this.#s(`Unexpected non-array element found while calculating columns: ${JSON.stringify(w)}`)}if(h===0)return this.#i="",this.#r=!1,"";let s;Array.isArray(this.#t.columnWidths)?s=this.#t.columnWidths.length>=h?this.#t.columnWidths.slice(0,h):[...this.#t.columnWidths,...Array.from({length:h-this.#t.columnWidths.length}).fill(void 0)]:typeof this.#t.columnWidths=="number"&&(s=Array.from({length:h}).fill(this.#t.columnWidths));let r;const n=o.length;if(Array.isArray(this.#t.rowHeights)?r=this.#t.rowHeights:typeof this.#t.rowHeights=="number"&&(r=Array.from({length:n}).fill(this.#t.rowHeights)),s||o.some(u=>Array.isArray(u)&&u.some(w=>typeof w=="object"&&w!==null&&!Array.isArray(w)&&w.width!==void 0))&&(s=Array.from({length:h}).fill(void 0)),s&&Array.isArray(s)){const u=[...s];for(const w of o){const p=w;let g=0;for(const f of p){let b={};if(typeof f=="object"&&f!==null&&!Array.isArray(f)){const{content:W,href:x,...y}=f;b=y}b.width!==void 0?u[g]=b.width:b.maxWidth!==void 0&&u[g]!==void 0&&(u[g]=Math.min(u[g],b.maxWidth)),g+=b.colSpan??1}}s=u}const a={autoFlow:"row",backgroundColor:this.#t.style?.backgroundColor,balancedWidths:this.#t.balancedWidths??!1,border:this.#t.style?.border,borderColor:this.#t.style?.borderColor,columns:h,fixedColumnWidths:s,fixedRowHeights:r,foregroundColor:this.#t.style?.foregroundColor,gap:this.#t.gap??0,maxWidth:this.#t.maxWidth,onWarn:this.#t.onWarn,paddingLeft:this.#t.style?.paddingLeft,paddingRight:this.#t.style?.paddingRight,terminalWidth:this.#t.terminalWidth,truncate:this.#t.truncate??(s?.every(u=>typeof u=="number")||this.#t.maxWidth!==void 0&&!this.#t.balancedWidths),truncateOverflow:this.#t.truncateOverflow??!0,wordWrap:this.#t.wordWrap??!1},c=new ct(a),l=[];if(this.#t.columnDefaults)for(const[u,w]of this.#t.columnDefaults.entries())w&&(l[u]={...w});if(this.#t.colAligns)for(const[u,w]of this.#t.colAligns.entries())w!==void 0&&(l[u]={...l[u],hAlign:l[u]?.hAlign??w});const d=l.length>0,m=[];for(const[u,w]of o.entries()){const p=w;if(!Array.isArray(p)){this.#s(`Skipping non-array row while creating GridItems: ${JSON.stringify(p)}`);continue}const g=this.#t.showHeader?this.#o.length:0,f=this.#e.length,b=this.#t.showHeader&&u<g,W=this.#t.showFooter&&u>=g+f,x=b&&p.length===1&&h>1,y=W&&p.length===1&&h>1;let R=0;for(const A of p){let v=A,B={};if(typeof v=="object"&&v!==null&&!Array.isArray(v)){const{content:_,href:T,...j}=v;v=T?`\x1B]8;;${de(T)}\x1B\\${String(_)}\x1B]8;;\x1B\\`:_,B=j}const C=d?l[R]:void 0;C&&(B={...B,hAlign:B.hAlign??C.hAlign,maxWidth:B.maxWidth??C.maxWidth,truncate:B.truncate??C.truncate,vAlign:B.vAlign??C.vAlign,wordWrap:B.wordWrap??C.wordWrap}),R+=B.colSpan??1,x&&(B.colSpan=h),y&&(B.colSpan=h);const E=this.#t.transformTabToSpace&&typeof v=="string"?v.replaceAll(" "," ".repeat(this.#t.transformTabToSpace)):v,{maxWidth:L}=B;m.push({backgroundColor:B.backgroundColor,colSpan:B.colSpan,content:E,foregroundColor:B.foregroundColor,hAlign:B.hAlign,maxWidth:L,rowSpan:B.rowSpan,truncate:B.truncate??(L===void 0?void 0:!0),vAlign:B.vAlign,wordWrap:B.wordWrap})}}return c.addItems(m),this.#i=c.toString(),this.#r=!1,this.#i}}const ve=t=>new ue(t);export{ve as N,Be as R,ye as a,be as c,ge as d,me as h,pe as i,ue as k,we as o,xe as r,ae as t,We as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class
|
|
1
|
+
class s extends Error{code;hint;docsUrl;packageName;file;line;constructor(e){super(e.message,{cause:e.cause}),this.name="VisReleaseError",this.code=e.code,this.hint=e.hint,this.docsUrl=e.docsUrl,this.packageName=e.packageName,this.file=e.file,this.line=e.line}}const a=r=>new s(r);export{s as VisReleaseError,a as visReleaseError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var t=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),t}export{l as a,a as c,f as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as D}from"node:module";import{w as q}from"./target-merge-D1xbylFw.js";import{advisoriesQuery as C,advisoriesIngest as M,advisoriesStatus as S,NATIVE_BINDING_VERSION as w}from"#native";let I;const R=e=>(I??=D(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,s]=u.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return u.getBuiltinModule(e)}return R(e)},{randomUUID:T}=l("node:crypto"),{existsSync:O,createWriteStream:$}=l("node:fs"),{mkdir:L,unlink:U,stat:x}=l("node:fs/promises"),{join:g,dirname:P}=l("node:path"),{Readable:k}=l("node:stream"),{pipeline:B}=l("node:stream/promises"),p=6;if(w!==p)throw new Error(`vis native binding ABI mismatch in advisories: expected ${p}, got ${w}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const X="https://osv-vulnerabilities.storage.googleapis.com",W=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class j extends Error{cause="DB_NOT_FOUND";constructor(t){super(`No local advisory DB at ${t}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class y extends Error{cause="SOURCE_NOT_ALLOWED";constructor(t){super(`Advisory source host '${t}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class _ extends Error{cause="SYNC_NETWORK";constructor(t,s){super(`Advisory sync failed for ${t}: ${s}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const v=e=>{const s=q("vis",{create:!0,cwd:e})??g(e,"node_modules",".cache","vis");return g(s,"advisories","db.sqlite")},V=(e,t)=>{let s;try{s=new URL(e)}catch{throw new y(e)}if(s.protocol!=="https:")throw new y(`${s.protocol}//${s.host}`);if(!new Set([...W,...t??[]]).has(s.host))throw new y(s.host);return s},J=async e=>{const t=e.dbPath??v(e.workspaceRoot);await L(P(t),{recursive:!0});const s=V(e.source,e.allowedHosts),n=new URL(`${e.ecosystem}/all.zip`,G(s.toString())),a=await H(t,e.ecosystem);let o=null;if(!e.force){const i=await E(n,{method:"HEAD"});if(i.ok&&(o=i.headers.get("etag"),o&&a&&o===a))return{advisoriesIngested:0,dbPath:t,durationMs:0,upToDate:!0}}const c=`${t}.${e.ecosystem}.${process.pid}.${T()}.zip.tmp`,r=await E(n,{method:"GET"});if(!r.ok||!r.body)throw new _(n.toString(),r.status);o||(o=r.headers.get("etag"));const m=r.headers.get("content-length"),d=m?Number.parseInt(m,10):null;let h=0;const b=$(c),f=k.fromWeb(r.body);e.onProgress&&d&&f.on("data",i=>{h+=i.byteLength,e.onProgress?.(h,d,"download")}),await B(f,b);try{const i=await M({dbPath:t,ecosystem:e.ecosystem,manifestEtag:o??void 0,zipPath:c},(A,N)=>e.onProgress?.(A,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:t,durationMs:i.durationMs,upToDate:!1}}finally{await U(c).catch(()=>{})}},Z=(e,t)=>{if(e.length===0)return new Map;const s=t.dbPath??v(t.workspaceRoot),n=t.ecosystem??"npm";if(!O(s))throw new j(s);const a=e.map(r=>({ecosystem:n,name:r.name,version:r.version})),o=C(s,a),c=new Map;for(const[r,m]of e.entries()){const d=o[r];!d||d.vulnerabilities.length===0||c.set(m.name,d.vulnerabilities.map(h=>z(h)))}return c},ee=async(e,t)=>{const s=t??v(e);return S(s)},H=async(e,t)=>{try{await x(e)}catch{return null}return S(e).ecosystems.find(a=>a.name===t)?.manifestEtag??null},z=e=>({aliases:e.aliases.length>0?e.aliases:void 0,cvssScore:e.cvssScore??void 0,fixedVersions:e.fixedVersions,id:e.id,severity:F(e.severity),summary:e.summary}),F=e=>{const t=e.toUpperCase();return t==="CRITICAL"||t==="HIGH"||t==="MODERATE"||t==="LOW"?t:"UNKNOWN"},G=e=>e.endsWith("/")?e:`${e}/`,E=async(e,t)=>{try{return await fetch(e,t)}catch(s){throw new _(e.toString(),s instanceof Error?s.message:String(s))}};export{j as A,X as D,ee as g,Z as q,v as r,J as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-jhNwmkZp.js";import{r as A}from"./affected-shas-Dd0P7fGD.js";let T;const $=e=>(T??=C(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return $(e)},{spawnSync:I}=R("node:child_process"),v=new Set(["deep","direct","none"]),B=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const p=o.slice(0,2),d=o.slice(3);if(d&&t.push(d),p.includes("R")||p.includes("C")){n+=1;const c=s[n];c&&t.push(c)}}return t},P=e=>{const t=I("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!v.has(n))throw new j(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!v.has(o))throw new j(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{projectGraph:p,projects:d,workspaceRoot:c}=t,u=[];let{base:m}=e,{head:r}=e;if(!m||!r){const l=A({defaultBase:s.defaultBase,workspaceRoot:c});m=m||l.base,r=r||l.head,u.push(`Resolved affected refs from ${l.provider} (${l.notes.join("; ")})`)}const k=s.runningInCi??W,h=r==="HEAD"||r==="",b=e.uncommitted??(!k&&h);let a=[];if(b)if(h){const g=(s.readWorkingTreeChanges??P)(c),y=Object.values(d).map(i=>i.root?.replace(/\/$/,"")).filter(i=>!!i&&i!==".");a=g.filter(i=>y.some(_=>i===_||i.startsWith(`${_}/`)));const w=g.length-a.length;a.length>0&&u.push(`including ${a.length} uncommitted working-tree file(s)`),w>0&&u.push(`ignoring ${w} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else u.push(`ignoring --uncommitted: --head=${r} pins the comparison to a commit, not the working tree`);return{...await S({additionalChangedFiles:a,base:m,downstream:n,head:r,projectGraph:p,projects:d,upstream:o,workspaceRoot:c}),notes:u,uncommittedFileCount:a.length}};export{D as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";import{z as g}from"./index-DHD8wb6Z.js";import{y as b}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let d;const E=e=>(d??=l(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,r]=u.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return u.getBuiltinModule(e)}return E(e)},{spawnSync:p}=h("node:child_process"),f="0000000000000000000000000000000000000000",A=e=>{if(b(e))try{const t=g(e);return JSON.parse(t)}catch{return}},I=(e,t)=>{const r=p("git",e,{cwd:t,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},_=e=>typeof e=="string"&&e.length>0&&e!==f,R=(e,t,r)=>{const o=[],s=e.GITHUB_BASE_REF,i=e.GITHUB_SHA??"HEAD";if(s&&s.length>0)return o.push(`pull_request: $GITHUB_BASE_REF=${s}`),{base:`origin/${s}`,head:i,notes:o,provider:"github"};const c=e.GITHUB_EVENT_PATH,a=c?r(c):void 0;if(a){const n=typeof a.before=="string"?a.before:void 0;if(_(n))return o.push(`push: event.before=${n}`),{base:n,head:i,notes:o,provider:"github"}}return o.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:i,notes:o,provider:"github"}},C=(e,t)=>{const r=[],o=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(_(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:o,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:o,notes:r,provider:"gitlab"}}const i=e.CI_COMMIT_BEFORE_SHA;if(_(i))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${i}`),{base:i,head:o,notes:r,provider:"gitlab"};const c=e.CI_DEFAULT_BRANCH??t;return r.push(`fallback: origin/${c}`),{base:`origin/${c}`,head:o,notes:r,provider:"gitlab"}},S=(e,t)=>{const r=[],o=e.BUILDKITE_COMMIT??"HEAD",s=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${t} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"buildkite"})},B=(e,t)=>{const r=[],o=e.CIRCLE_SHA1??"HEAD",s=e.CIRCLE_PR_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${t} (circleci has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"circleci"})},v=(e,t,r)=>{const o=[],s=t(["merge-base","HEAD",`origin/${e}`],r);return s&&s.length>0?(o.push(`local: git merge-base HEAD origin/${e}=${s}`),{base:s,head:"HEAD",notes:o,provider:"local"}):(o.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:o,provider:"local"})},m=e=>{const t=e?.env??process.env,r=e?.defaultBase??"main",o=e?.readEventPayload??A,s=e?.runGit??I,i=e?.workspaceRoot??process.cwd();return t.GITHUB_ACTIONS==="true"?R(t,r,o):t.GITLAB_CI==="true"?C(t,r):t.BUILDKITE==="true"?S(t,r):t.CIRCLECI==="true"?B(t,r):v(r,s,i)};export{m as r};
|